throw new IllegalArgumentException("Argument must be a directory.");
}
logger.log(Level.INFO, "Loading flow-tools files from " + startDir.getAbsolutePath());
FlowSourceSet ftDir = new FlowSourceSet();
Deque<File> dirStack = new LinkedList<File>();
dirStack.add(startDir);
int i = 0;
do {
File curDir = dirStack.removeFirst();
logger.log(Level.FINER, "Entering directory " + curDir.getAbsolutePath());
for (File f : curDir.listFiles()) {
if (f.isDirectory() && recursive) {
dirStack.addFirst(f);
continue;
} else if (!f.isFile()) {
logger.log(Level.INFO, "Skipping " + f.getAbsolutePath() + ": not a file.");
continue;
}
try {
ftDir.addFlowSource(getSourceFromFile(f));
i++;
logger.log(Level.FINE, "File " + f.getAbsolutePath() + " loaded.");
} catch (FileNotFoundException ex) {
logger.log(Level.SEVERE, null, ex);
} catch (IOException ex) {