SmosUtils { @SuppressWarnings("SimplifiableIfStatement") public static boolean isCompressedFile(File file) { final String extension = FileUtils.getExtension(file); if (StringUtils.isNullOrEmpty(extension)) { return false; } return extension.contains("zip") || extension.contains("ZIP"); }  static File findDblFile(File[] zipFiles); static Date getSensingStartDayFromFilename(String fileName); static Date getSensingStartTimeFromFilename(String fileName); static Date getSensingStopTimeFromFilename(String fileName); static String getProductType(String fileName); static boolean isDblFileName(String fileName); static boolean isHdrFileName(String fileName); static boolean isL0Type(String fileName); static boolean isL1aType(String fileName); static boolean isL1bType(String fileName); static boolean isL1cType(String fileName); static boolean isLightBufrType(String fileName); static boolean isLightBufrTypeSupported(); static boolean isL2Type(String fileName); static boolean isAuxFileType(String fileName); static boolean isQualityControlType(String fileName); static boolean isMirasPlanType(String fileName); static boolean isAuxECMWFType(String fileName); static boolean isOsAnalysisFormat(String formatName); static boolean isOsUserFormat(String formatName); static boolean isSmAnalysisFormat(String formatName); static boolean isSmUserFormat(String formatName); static boolean isDualPolBrowseFormat(String formatName); static boolean isFullPolBrowseFormat(String formatName); static boolean isBrowseFormat(String formatName); static boolean isDualPolScienceFormat(String formatName); static boolean isFullPolScienceFormat(String formatName); @SuppressWarnings("SimplifiableIfStatement") static boolean isCompressedFile(File file); static boolean isDggTlvFormat(String formatName); static boolean isDggTfoFormat(String formatName); static boolean isDggRouFormat(String formatName); static boolean isDggRfiFormat(String formatName); static boolean isDggFloFormat(String formatName); static boolean isLsMaskFormat(String formatName); static boolean isVTecFormat(String formatName); static boolean isDffLaiFormat(String formatName); static boolean isL2Format(String formatName);  }
@Test public void testIsCompressedFile() { final File fileWithoutExtension = new File("a_file_without_extension"); assertFalse(SmosUtils.isCompressedFile(fileWithoutExtension)); final File textFile = new File("bla.txt"); assertFalse(SmosUtils.isCompressedFile(textFile)); final File zipFile = new File("gna.zip"); assertTrue(SmosUtils.isCompressedFile(zipFile)); final File zipFileWithCapitalExtension = new File("firlefanz.ZIP"); assertTrue(SmosUtils.isCompressedFile(zipFileWithCapitalExtension)); }