PixExOp extends Operator { public static Set<File> getSourceProductFileSet(String[] sourceProductPaths, Logger logger) { Set<File> sourceProductFileSet = new TreeSet<>(); String[] paths = trimSourceProductPaths(sourceProductPaths); if (paths != null && paths.length != 0) { for (String path : paths) { try { WildcardMatcher.glob(path, sourceProductFileSet); } catch (IOException e) { logger.severe("I/O problem occurred while scanning source product files: " + e.getMessage()); } } if (sourceProductFileSet.isEmpty()) { logger.log(Level.WARNING, "No valid source product path found."); } } return sourceProductFileSet; }  @SuppressWarnings({"unchecked", "ConstantConditions"}) static Coordinate.OriginalValue[] getOriginalValues(SimpleFeature feature); @Override void initialize(); static Set<File> getSourceProductFileSet(String[] sourceProductPaths, Logger logger); @Override void dispose(); static final String RECURSIVE_INDICATOR; static final String NO_AGGREGATION; static final String MEAN_AGGREGATION; static final String MIN_AGGREGATION; static final String MAX_AGGREGATION; static final String MEDIAN_AGGREGATION; }
@Test public void testGetParsedInputPaths() throws Exception { final File testDir = getOutputDir("testGetParsedInputPaths", getClass()); final File subDir1 = new File(testDir, "subDir1"); final File subDir2 = new File(testDir, "subDir2"); final File subDir2_1 = new File(subDir2, "subDir2_1"); final File subDir2_2 = new File(subDir2, "subDir2_2"); testDir.mkdir(); subDir1.mkdir(); subDir2.mkdir(); subDir2_1.mkdir(); subDir2_2.mkdir(); final String pattern = testDir.getCanonicalPath() + File.separator + PixExOp.RECURSIVE_INDICATOR; Set<File> dirList = PixExOp.getSourceProductFileSet(new String[]{pattern}, Logger.getAnonymousLogger()); assertEquals(4, dirList.size()); assertTrue("Missing dir '" + subDir1.getCanonicalPath() + "'.", dirList.contains(subDir1.getCanonicalFile())); assertTrue("Missing dir '" + subDir2.getCanonicalPath() + "'.", dirList.contains(subDir2.getCanonicalFile())); assertTrue("Missing dir '" + subDir2_1.getCanonicalPath() + "'.", dirList.contains(subDir2_1.getCanonicalFile())); assertTrue("Missing dir '" + subDir2_2.getCanonicalPath() + "'.", dirList.contains(subDir2_2.getCanonicalFile())); dirList = PixExOp.getSourceProductFileSet(new String[]{testDir.getPath(), subDir2_1.getPath()}, Logger.getAnonymousLogger()); assertEquals(2, dirList.size()); assertTrue("Missing dir '" + testDir.getCanonicalPath() + "'.", dirList.contains(testDir.getCanonicalFile())); assertTrue("Missing dir '" + subDir2_1.getCanonicalPath() + "'.", dirList.contains(subDir2_1.getCanonicalFile())); }