long lastModified = ((Long) app.redeployResources.get(resources[i])).longValue();
if ((!resource.isDirectory()) && resource.lastModified() > lastModified) {
// Undeploy application
if (log.isInfoEnabled())
log.info(sm.getString("hostConfig.undeploy", app.name));
ContainerBase context = (ContainerBase) host.findChild(app.name);
try {
host.removeChild(context);
} catch (Throwable t) {
log.warn(sm.getString
("hostConfig.context.remove", app.name), t);
}
try {
context.destroy();
} catch (Throwable t) {
log.warn(sm.getString
("hostConfig.context.destroy", app.name), t);
}
// Delete other redeploy resources
for (int j = i + 1; j < resources.length; j++) {
try {
File current = new File(resources[j]);
current = current.getCanonicalFile();
if ((current.getAbsolutePath().startsWith(appBase().getAbsolutePath()))
|| (current.getAbsolutePath().startsWith(configBase().getAbsolutePath()))) {
if (log.isDebugEnabled())
log.debug("Delete " + current);
ExpandWar.delete(current);
}
} catch (IOException e) {
log.warn(sm.getString
("hostConfig.canonicalizing", app.name), e);
}
}
deployed.remove(app.name);
return;
}
} else {
long lastModified = ((Long) app.redeployResources.get(resources[i])).longValue();
if (lastModified == 0L) {
continue;
}
// Undeploy application
if (log.isInfoEnabled())
log.info(sm.getString("hostConfig.undeploy", app.name));
ContainerBase context = (ContainerBase) host.findChild(app.name);
try {
host.removeChild(context);
} catch (Throwable t) {
log.warn(sm.getString
("hostConfig.context.remove", app.name), t);
}
try {
context.destroy();
} catch (Throwable t) {
log.warn(sm.getString
("hostConfig.context.destroy", app.name), t);
}
// Delete all redeploy resources