+ resourceConfig.toExternalForm());
}
InputStream in = URLToStreamHelper.urlToStream(resourceConfig);
try {
Digester digester = new Digester();
digester.setValidating(false);
digester.setEntityResolver(new EntityResolver() {
// Dummi resolver - alvays do nothing
public InputSource resolveEntity(String publicId,
String systemId) throws SAXException, IOException {
return new InputSource(new StringReader(""));
}
});
digester.setNamespaceAware(false);
digester.setUseContextClassLoader(true);
digester.push(this);
digester.addObjectCreate("resource-config/resource", "class",
JarResource.class);
digester.addObjectCreate("resource-config/resource/renderer",
"class", HTMLRenderer.class);
digester.addCallMethod(
"resource-config/resource/renderer/content-type",
"setContentType", 0);
digester.addSetNext("resource-config/resource/renderer",
"setRenderer", ResourceRenderer.class.getName());
digester.addCallMethod("resource-config/resource/name",
"setKey", 0);
digester.addCallMethod("resource-config/resource/path",
"setPath", 0);
digester.addCallMethod("resource-config/resource/cacheable",
"setCacheable", 0);
digester.addCallMethod(
"resource-config/resource/session-aware",
"setSessionAware", 0);
digester.addCallMethod("resource-config/resource/property",
"setProperty", 2);
digester.addCallParam("resource-config/resource/property/name",
0);
digester.addCallParam(
"resource-config/resource/property/value", 1);
digester.addCallMethod("resource-config/resource/content-type",
"setContentType", 0);
digester.addSetNext("resource-config/resource", "addResource",
InternetResource.class.getName());
digester.parse(in);
} finally {
in.close();
}
} catch (IOException e) {
throw new FacesException(e);