public static boolean isValidCompressFormat ( final String compressFormat ) throws CompressionException { if ( ! StringUtils . hasText ( compressFormat ) ) { throw new CompressionException ( "Compress format is either null or empty!" ) ; } else if ( compressFormat . equalsIgnoreCase ( GZIP_COMPRESS_FORMAT ) || compressFormat . equalsIgnoreCase ( DEFLATE_COMPRESS_FORMAT ) ) { return true ; } else { throw new CompressionException ( "There is no compression technique for the given compress format : " + compressFormat ) ; } }
Method to validate whether the given compression format is valid