private synchronized void addResourceObject(Resource resource) { resources.add(resource); // add to resources restrictSystemProps |= resource.isParserRestricted(); reloadConfiguration(); }
private XMLStreamReader2 getStreamReader(Resource wrapper, boolean quiet) throws XMLStreamException, IOException { Object resource = wrapper.getResource(); boolean isRestricted = wrapper.isParserRestricted(); XMLStreamReader2 reader = null; if (resource instanceof URL) { // an URL resource reader = (XMLStreamReader2)parse((URL)resource, isRestricted); } else if (resource instanceof String) { // a CLASSPATH resource URL url = getResource((String)resource); reader = (XMLStreamReader2)parse(url, isRestricted); } else if (resource instanceof Path) { // a file resource // Can't use FileSystem API or we get an infinite loop // since FileSystem uses Configuration API. Use java.io.File instead. File file = new File(((Path)resource).toUri().getPath()) .getAbsoluteFile(); if (file.exists()) { if (!quiet) { LOG.debug("parsing File " + file); } reader = (XMLStreamReader2)parse(new BufferedInputStream( new FileInputStream(file)), ((Path)resource).toString(), isRestricted); } } else if (resource instanceof InputStream) { reader = (XMLStreamReader2)parse((InputStream)resource, null, isRestricted); } return reader; }
private synchronized void addResourceObject(Resource resource) { resources.add(resource); // add to resources restrictSystemProps |= resource.isParserRestricted(); reloadConfiguration(); }
boolean useXInclude = !wrapper.isParserRestricted(); try { docBuilderFactory.setXIncludeAware(useXInclude); + ") for parser " + docBuilderFactory, e); if (wrapper.isParserRestricted()) { docBuilderFactory.setFeature( "http://apache.org/xml/features/disallow-doctype-decl", true); if ("configuration".equals(prop.getTagName())) { loadResource(toAddTo, new Resource(prop, name, wrapper.isParserRestricted()), quiet); continue; if (wrapper.isParserRestricted() && XINCLUDE_NS_URI.equals(prop.getNamespaceURI())) { throw new RuntimeException("Error parsing resource " + wrapper return new Resource(toAddTo, name, wrapper.isParserRestricted());
private synchronized void addResourceObject(Resource resource) { resources.add(resource); // add to resources restrictSystemProps |= resource.isParserRestricted(); reloadConfiguration(); }
if (include != null) { Resource classpathResource = new Resource(include, name, wrapper.isParserRestricted()); wrapper.isParserRestricted());
XMLStreamReader2 reader = null; boolean returnCachedProperties = false; boolean isRestricted = wrapper.isParserRestricted(); if (include != null) { Resource classpathResource = new Resource(include, name, wrapper.isParserRestricted()); loadResource(properties, classpathResource, quiet); } else { wrapper.isParserRestricted()); loadResource(properties, uriResource, quiet); return new Resource(toAddTo, name, wrapper.isParserRestricted());
return new Resource(toAddTo, name, wrapper.isParserRestricted());
Parser(XMLStreamReader2 reader, Resource wrapper, boolean quiet) { this.reader = reader; this.wrapper = wrapper; this.name = wrapper.getName(); this.nameSingletonArray = new String[]{ name }; this.isRestricted = wrapper.isParserRestricted(); this.quiet = quiet; }