SmosUtils { public static String getProductType(String fileName) { fileName = new File(fileName).getName(); final String fileType; if (isAuxFileType(fileName)) { fileType = "AUX_DATA"; } else if (isQualityControlType(fileName)) { fileType = "RQC_RQD"; } else { fileType = getProductTypeFromFilename(fileName); } return fileType; }  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 testGetProductType() { assertEquals("AUX_DATA", SmosUtils.getProductType("SM_TEST_AUX_LSMASK_20070101T000000_20781231T235959_00000001.EEF")); assertEquals("AUX_DATA", SmosUtils.getProductType("SM_TEST_AUX_BFP____20070101T000000_20781231T235959_00000004.EEF")); assertEquals("AUX_DATA", SmosUtils.getProductType("SM_TEST_AUX_SUNT___20070101T000000_20781231T235959_00000001.EEF")); assertEquals("MIR_GMATD_", SmosUtils.getProductType("SM_TEST_MIR_GMATD__20121117T020130_20781231T235959_115_001_3.tgz")); assertEquals("AUX_DATA", SmosUtils.getProductType("SM_TEST_AUX_CNFL1P_20120101T000000_20500101T000000_101_001_3.EEF")); assertEquals("MIR_CRSD1A", SmosUtils.getProductType("SM_OPER_MIR_CRSD1a_20121117T025249_20121117T043300_116_001_1.zip")); assertEquals("RQC_RQD", SmosUtils.getProductType("SM_OPER_RQC_VTEC_C_20090512T230000_20090514T010000_311_001_1.EEF")); assertEquals("RQC_RQD", SmosUtils.getProductType("SM_TEST_RQD_SCND1C_20121117T120515_20121117T122512_311_001_1.EEF")); }