SmosUtils { public static boolean isL1aType(String fileName) { return fileName.matches("SM_.{4}_MIR_SC_[DF]1[Aa]_.{45}") || fileName.matches("SM_.{4}_MIR_TAR[DF]1[Aa]_.{45}") || fileName.matches("SM_.{4}_MIR_AFW[DU]1[Aa]_.{45}") || fileName.matches("SM_.{4}_MIR_ANIR1[Aa]_.{45}") || fileName.matches("SM_.{4}_MIR_UNC[DNU]1[Aa]_.{45}") || fileName.matches("SM_.{4}_MIR_CORN1[Aa]_.{45}") || fileName.matches("SM_.{4}_MIR_CRS[DU]1[Aa]_.{45}") || fileName.matches("SM_.{4}_MIR_UAV[DU]1[Aa]_.{45}") || fileName.matches("SM_.{4}_MIR_NIR_1[Aa]_.{45}") || fileName.matches("SM_.{4}_MIR_FWAS1[Aa]_.{45}") || fileName.matches("SM_.{4}_TLM_MIRA1[Aa]_.{45}"); }  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 testIsL1aFileType() { assertTrue(SmosUtils.isL1aType("SM_OPER_MIR_TARD1A_20121117T102025_20121117T105144_203_001_1.EEF")); assertTrue(SmosUtils.isL1aType("SM_OPER_MIR_CRSD1A_20121117T025249_20121117T043300_116_001_1.zip")); assertTrue(SmosUtils.isL1aType("SM_TEST_MIR_AFWU1A_20121117T022130_20121117T024030_203_001_1.EEF")); assertTrue(SmosUtils.isL1aType("SM_TEST_MIR_ANIR1A_20121119T213500_20121119T231156_306_001_3.zip")); assertFalse(SmosUtils.isL1aType("SM_TEST_MIR_GMATD__20121117T020130_20781231T235959_115_001_3.tgz")); assertFalse(SmosUtils.isL1aType("SM_OPER_RQD_BWSF1C_20121120T015956_20121120T023316_203_001_1.EEF")); assertFalse(SmosUtils.isL1aType("SM_OPER_AUX_ORBRES_20121118T000000_20121125T000000_240_028_1.EEF")); }