File contextBase = context.getAbsoluteAppBase();
if (!contextBase.exists() || !contextBase.isDirectory())
{
return;
}
ContextDeployer deployer = (ContextDeployer) context;
String xpdlFiles[] = deployer.findDeployedPackages();
for (int i = 0; i < xpdlFiles.length; i++)
{
String xpdlFileName = xpdlFiles[i];
File xpdlBase = new File(contextBase, "WEB-INF/xpdl");
File xpdlFile = new File(xpdlBase, xpdlFileName);
long newLastModified = xpdlFile.lastModified();
Long lastModified = (Long) xpdlXmlLastModified.get(xpdlFileName);
if (lastModified == null)
{
xpdlXmlLastModified.put(xpdlFileName, new Long(newLastModified));
}
else
{
if (lastModified.longValue() != newLastModified)
{
if (newLastModified > (lastModified.longValue() + 5000))
{
xpdlXmlLastModified.remove(xpdlFileName);
try
{
URL url = new URL("file", null, xpdlFile.getCanonicalPath());
deployer.remove(xpdlFileName);
deployer.install(xpdlFileName, url);
}
catch (Throwable t)
{
log.error(sm.getString("contextConfig.deployXPDL.error", xpdlFile.getName()), t);
}