SmosUtils { public static File findDblFile(File[] zipFiles) { File dblFile = null; if (zipFiles.length == 1) { dblFile = zipFiles[0]; } else { for (File zipFile : zipFiles) { if (zipFile.getName().matches(".+\\.[dD][bB][lL]")) { dblFile = zipFile; break; } } } return dblFile; }  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 testFindDblFile() { File[] inputFiles = new File[0]; assertNull(SmosUtils.findDblFile(inputFiles)); inputFiles = new File[]{new File("murks.txt"), new File("blärks.dot")}; assertNull(SmosUtils.findDblFile(inputFiles)); inputFiles = new File[]{new File("murks.DBL"), new File("blärks.dot")}; File dblFile = SmosUtils.findDblFile(inputFiles); assertEquals("murks.DBL", dblFile.getName()); inputFiles = new File[]{new File("murks.txt"), new File("blärks.dbl")}; dblFile = SmosUtils.findDblFile(inputFiles); assertEquals("blärks.dbl", dblFile.getName()); inputFiles = new File[]{new File("hoppla.dbl")}; dblFile = SmosUtils.findDblFile(inputFiles); assertEquals("hoppla.dbl", dblFile.getName()); }