Long rootLastModified = root.getLastModified();
String name = root.getPathName();
// Check for removal
if( root.exists() == false )
{
ModificationInfo info = new ModificationInfo(ctx, rootLastModified, ModifyStatus.REMOVED);
modified.add(info);
iter.remove();
if( trace )
log.trace(name+" was removed");
}
// Check for modification
else if( root.hasBeenModified() )
{
if( trace )
log.trace(name+" was modified: "+rootLastModified);
// Need to create a duplicate ctx
VFSDeployment ctx2 = loadDeploymentData(root);
ModificationInfo info = new ModificationInfo(ctx2, rootLastModified, ModifyStatus.MODIFIED);
modified.add(info);
}
// TODO: this could check metadata files modifications as well
}
// Now check for additions
for (File applicationDir : applicationDirs)
{
VirtualFile deployDir = VFS.getRoot(applicationDir.toURI());
List<VirtualFile> children = deployDir.getChildren();
for(VirtualFile vf : children)
{
URI uri = vf.toURI();
if( applicationCtxs.containsKey(uri.toString()) == false )
{
VFSDeployment ctx = loadDeploymentData(vf);
ModificationInfo info = new ModificationInfo(ctx, vf.getLastModified(), ModifyStatus.ADDED);
modified.add(info);
applicationCtxs.put(vf.toURI().toString(), ctx);
}
}
}