SmosUtils { public static boolean isL2Type(String fileName) { return fileName.matches("SO_.{4}_MIR_TSM_2__.{45}") || fileName.matches("SO_.{4}_MIR_TOS_2__.{45}") || fileName.matches("SO_.{4}_MIR_SM__2__.{45}") || fileName.matches("SM_.{4}_MIR_(SM|OS)UDP2_.{45}") || fileName.matches("SM_.{4}_MIR_(SM|OS)DAP2_.{45}") || fileName.matches("SO_.{4}_MIR_OS__2__.{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 testIsL2FileType() { assertTrue(SmosUtils.isL2Type("SO_GNAT_MIR_TSM_2__20070223T061024_20070223T062500_001_001_0.DBL")); assertTrue(SmosUtils.isL2Type("SO_GNOT_MIR_TOS_2__20070223T061024_20070223T062500_001_001_0.DBL")); assertTrue(SmosUtils.isL2Type("SO_GNAT_MIR_SM__2__20070223T061024_20070223T062500_001_001_0.DBL")); assertTrue(SmosUtils.isL2Type("SO_GNOT_MIR_OS__2__20070223T061024_20070223T062500_001_001_0.DBL")); assertTrue(SmosUtils.isL2Type("SM_TEST_MIR_SMUDP2_20121118T143742_20121118T153047_303_002_1.zip")); assertTrue(SmosUtils.isL2Type("SM_TEST_MIR_SMDAP2_20121118T135052_20121118T144140_303_007_1.zip")); assertTrue(SmosUtils.isL2Type("SM_TEST_MIR_OSUDP2_20121118T143742_20121118T153047_306_002_1.zip")); assertTrue(SmosUtils.isL2Type("SM_TEST_MIR_OSDAP2_20121118T143742_20121118T153047_306_002_1.zip")); assertFalse(SmosUtils.isL2Type("SM_TEST_AUX_IGRF___20080102T010000_20080102T025959_105_001_0.zip")); assertFalse(SmosUtils.isL2Type("SM_TEST_AUX_PATT99_20070101T000000_20781231T235959_00000006.EEF")); assertFalse(SmosUtils.isL2Type("SM_TEST_MIR_SC_F0__20070223T112710_20070223T121514_001_001_0.DBL")); }