SmosUtils { public static boolean isLightBufrType(String fileName) { return fileName.matches( "W_ES-ESA-ESAC,SMOS,N256_C_LEMM_[0-9]{14}_[0-9]{14}_[0-9]{14}_bufr_v[0-9]{3}\\.bin"); }  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 testIsLightBufrSpecification() throws Exception { assertTrue(SmosUtils.isLightBufrType( "W_ES-ESA-ESAC,SMOS,N256_C_LEMM_20131028030552_20131028003256_20131028020943_bufr_v505.bin")); assertTrue(SmosUtils.isLightBufrType( "W_ES-ESA-ESAC,SMOS,N256_C_LEMM_20131028033037_20131028002942_20131028003302_bufr_v505.bin")); assertTrue(SmosUtils.isLightBufrType( "W_ES-ESA-ESAC,SMOS,N256_C_LEMM_20131028044206_20131028020942_20131028034943_bufr_v505.bin")); assertTrue(SmosUtils.isLightBufrType( "W_ES-ESA-ESAC,SMOS,N256_C_LEMM_20131028044206_20131028020942_20131028034943_bufr_v647.bin")); assertFalse(SmosUtils.isLightBufrType( "W_ES-ESA-ESAC,SMOS,N256_D_LEMM_20131028044206_20131028020942_20131028034943_bufr_v505.bin")); assertFalse(SmosUtils.isLightBufrType( "W_ES-ESA-ESAC,SMOS,N256_C_LEMN_20131028044206_20131028020942_20131028034943_bufr_v505.bin")); assertFalse(SmosUtils.isLightBufrType( "W_ES-ESA-ESAC,SMOS,N256_C_LEMN_20131028044206_20131028020942_20131028034943_bufr_v505.zip")); }