rendered paste body private Map<SFVFile, LinkedRemoteFileInterface> findIncompleteSFVs(Collection<SectionInterface> sections) {
Map<SFVFile, LinkedRemoteFileInterface> incompleteSfv = new HashMap<SFVFile, LinkedRemoteFileInterface>();
List<LinkedRemoteFileInterface> uncheckedDirs = new ArrayList<LinkedRemoteFileInterface>();
//add all dirs in sections
for (SectionInterface section : sections) {
uncheckedDirs.addAll(section.getBaseFile().getDirectories());
}
//check for subdirs to process and add all non complete sfvfiles
while (!uncheckedDirs.isEmpty()) {
LinkedRemoteFileInterface file = uncheckedDirs.remove(0);
try {
SFVFile sfv = file.lookupSFVFile();
if (sfv != null && !sfv.getStatus().isFinished())
incompleteSfv.put(sfv, file);
} catch (FileNotFoundException e) {
//no sfv, ignore that
} catch (IOException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
} catch (NoAvailableSlaveException e) {
e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
}
if (file.isDirectory()) {
uncheckedDirs.addAll(file.getDirectories());
}
}
return incompleteSfv;