ExporterUtils { static TreeSet<File> createInputFileSet(String[] sourceProductPaths) { final TreeSet<File> globbedFileSet = new TreeSet<>(); try { for (String sourceProductPath : sourceProductPaths) { sourceProductPath = sourceProductPath.trim(); WildcardMatcher.glob(sourceProductPath, globbedFileSet); } } catch (IOException e) { throw new OperatorException(e.getMessage()); } return ensureNoDuplicateDblFiles(globbedFileSet); }    }
@Test public void testCreateInputFileSet_oneDir_wildcard() { final String resourcePath = getResourcePath(); final TreeSet<File> inputFileSet = ExporterUtils.createInputFileSet(new String[]{resourcePath + File.separator + "*BWL*"}); assertNotNull(inputFileSet); assertEquals(1, inputFileSet.size()); final Iterator<File> iterator = inputFileSet.iterator(); assertEquals("SM_OPER_MIR_BWLF1C_20111026T143206_20111026T152520_503_001_1.zip", iterator.next().getName()); }
@Test public void testCreateInputFileSet_emptyList() { final TreeSet<File> inputFileSet = ExporterUtils.createInputFileSet(new String[0]); assertNotNull(inputFileSet); assertEquals(0, inputFileSet.size()); }
@Test public void testCreateInputFileSet_oneDir() { final String resourcePath = getResourcePath(); final TreeSet<File> inputFileSet = ExporterUtils.createInputFileSet(new String[]{resourcePath + File.separator + "*"}); assertNotNull(inputFileSet); assertEquals(4, inputFileSet.size()); final Iterator<File> iterator = inputFileSet.iterator(); assertEquals("SM_OPER_MIR_BWLF1C_20111026T143206_20111026T152520_503_001_1.zip", iterator.next().getName()); assertEquals("SM_OPER_MIR_OSUDP2_20091204T001853_20091204T011255_310_001_1.zip", iterator.next().getName()); assertEquals("SM_OPER_MIR_SMUDP2_20120514T163815_20120514T173133_551_001_1.zip", iterator.next().getName()); assertEquals("SM_REPB_MIR_SCLF1C_20110201T151254_20110201T151308_505_152_1.zip", iterator.next().getName()); }