Iterator<ResourceFileLocation> addedItr = addedFiles.iterator();
Iterator<ResourceFileLocation> removedItr = removedFiles.iterator();
while(addedItr.hasNext()) {
updated = true;
ResourceFileLocation location = addedItr.next();
LOGGER.info("Added " + location.getName() + " " + location.getUrl());
db.addNameUrl(location.getName(), location.getUrl());
}
while(removedItr.hasNext()) {
updated = true;
ResourceFileLocation location = removedItr.next();
LOGGER.info("Removed " + location.getName() + " " + location.getUrl());
db.removeNameUrl(location.getName(), location.getUrl());
}
if(updated) {
// lastly replace the state file with the new version:
if(!current.delete()) {
throw new IOException("Unable to delete " +