Set<VirtualFile> overlays = warMetaData.getOverlays();
if (overlays != null) {
if (context.getResources() instanceof ProxyDirContext) {
ProxyDirContext resources = (ProxyDirContext) context.getResources();
for (VirtualFile overlay : overlays) {
VFSDirContext dirContext = new VFSDirContext();
dirContext.setVirtualFile(overlay);
resources.addOverlay(dirContext);
}
} else if (overlays.size() > 0) {
// Error, overlays need a ProxyDirContext to compose results
WebLogger.WEB_LOGGER.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);
}
}
}