for (VirtualFile overlay : overlays)
{
// JBAS-7832: Replaced with FileDirContext for now
//VFSDirContext vfsDirContext = new VFSDirContext(overlay);
//resources.addOverlay(vfsDirContext);
FileDirContext dirContext = new FileDirContext();
try
{
dirContext.setDocBase(overlay.getPhysicalFile().getAbsolutePath());
resources.addOverlay(dirContext);
}
catch (IOException e)
{
log.error(sm.getString("contextConfig.noOverlay", context.getName()), e);
ok = false;
break;
}
}
}
else if (overlays.size() > 0)
{
// Error, overlays need a ProxyDirContext to compose results
log.error(sm.getString("contextConfig.noOverlay", context.getName()));
ok = false;
}
}
}
// Add other overlays, if any
if (ok)
{
for (String overlay : overlays)
{
if (context.getResources() instanceof ProxyDirContext)
{
ProxyDirContext resources = (ProxyDirContext) context.getResources();
FileDirContext dirContext = new FileDirContext();
dirContext.setDocBase(overlay);
resources.addOverlay(dirContext);
}
}
}