Resource classpathResource = new Resource(include, name, wrapper.isParserRestricted()); Resource uriResource = new Resource(url, name, wrapper.isParserRestricted());
String name = UNKNOWN_RESOURCE; try { Object resource = wrapper.getResource(); name = wrapper.getName(); XMLStreamReader2 reader = null; boolean returnCachedProperties = false; boolean isRestricted = wrapper.isParserRestricted(); Resource classpathResource = new Resource(include, name, wrapper.isParserRestricted()); loadResource(properties, classpathResource, quiet); } else { Resource uriResource = new Resource(url, name, wrapper.isParserRestricted()); loadResource(properties, uriResource, quiet); return new Resource(toAddTo, name, wrapper.isParserRestricted());
private Resource loadResource(Properties properties, Resource wrapper, boolean quiet) { String name = UNKNOWN_RESOURCE; try { Object resource = wrapper.getResource(); name = wrapper.getName(); Element prop = (Element)propNode; if ("configuration".equals(prop.getTagName())) { loadResource(toAddTo, new Resource(prop, name), quiet); continue; return new Resource(toAddTo, name);
private Resource loadResource(Properties properties, Resource wrapper, boolean quiet) { String name = UNKNOWN_RESOURCE; try { Object resource = wrapper.getResource(); name = wrapper.getName(); Element prop = (Element)propNode; if ("configuration".equals(prop.getTagName())) { loadResource(toAddTo, new Resource(prop, name), quiet); continue; return new Resource(toAddTo, name);
private Resource loadResource(Properties properties, Resource wrapper, boolean quiet) { String name = UNKNOWN_RESOURCE; try { Object resource = wrapper.getResource(); name = wrapper.getName(); 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 Resource loadResource(Properties properties, Resource wrapper, boolean quiet) { String name = UNKNOWN_RESOURCE; try { Object resource = wrapper.getResource(); name = wrapper.getName(); Element prop = (Element)propNode; if ("configuration".equals(prop.getTagName())) { loadResource(toAddTo, new Resource(prop, name), quiet); continue; return new Resource(toAddTo, name);
private void loadResources(Properties properties, ArrayList<Resource> resources, boolean quiet) { if(loadDefaults) { for (String resource : defaultResources) { loadResource(properties, new Resource(resource), quiet); } //support the hadoop-site.xml as a deprecated case if(getResource("hadoop-site.xml")!=null) { loadResource(properties, new Resource("hadoop-site.xml"), quiet); } } for (int i = 0; i < resources.size(); i++) { Resource ret = loadResource(properties, resources.get(i), quiet); if (ret != null) { resources.set(i, ret); } } }
private void loadResources(Properties properties, ArrayList<Resource> resources, boolean quiet) { if(loadDefaults) { for (String resource : defaultResources) { loadResource(properties, new Resource(resource, false), quiet); } //support the hadoop-site.xml as a deprecated case if(getResource("hadoop-site.xml")!=null) { loadResource(properties, new Resource("hadoop-site.xml", false), quiet); } } for (int i = 0; i < resources.size(); i++) { Resource ret = loadResource(properties, resources.get(i), quiet); if (ret != null) { resources.set(i, ret); } } }
private void loadResources(Properties properties, ArrayList<Resource> resources, boolean quiet) { if(loadDefaults) { for (String resource : defaultResources) { loadResource(properties, new Resource(resource), quiet); } //support the hadoop-site.xml as a deprecated case if(getResource("hadoop-site.xml")!=null) { loadResource(properties, new Resource("hadoop-site.xml"), quiet); } } for (int i = 0; i < resources.size(); i++) { Resource ret = loadResource(properties, resources.get(i), quiet); if (ret != null) { resources.set(i, ret); } } }
private void loadResources(Properties properties, ArrayList<Resource> resources, boolean quiet) { if(loadDefaults) { for (String resource : defaultResources) { loadResource(properties, new Resource(resource), quiet); } //support the hadoop-site.xml as a deprecated case if(getResource("hadoop-site.xml")!=null) { loadResource(properties, new Resource("hadoop-site.xml"), quiet); } } for (int i = 0; i < resources.size(); i++) { Resource ret = loadResource(properties, resources.get(i), quiet); if (ret != null) { resources.set(i, ret); } } }
/** * Add a configuration resource. * * The properties of this resource will override properties of previously * added resources, unless they were marked <a href="#Final">final</a>. * * WARNING: The contents of the InputStream will be cached, by this method. * So use this sparingly because it does increase the memory consumption. * * @param in InputStream to deserialize the object from. In will be read from * when a get or set is called next. After it is read the stream will be * closed. */ public void addResource(InputStream in) { addResourceObject(new Resource(in)); }
/** * Add a configuration resource. * * The properties of this resource will override properties of previously * added resources, unless they were marked <a href="#Final">final</a>. * * WARNING: The contents of the InputStream will be cached, by this method. * So use this sparingly because it does increase the memory consumption. * * @param in InputStream to deserialize the object from. In will be read from * when a get or set is called next. After it is read the stream will be * closed. */ public void addResource(InputStream in) { addResourceObject(new Resource(in)); }
/** * Add a configuration resource. * * The properties of this resource will override properties of previously * added resources, unless they were marked <a href="#Final">final</a>. * * WARNING: The contents of the InputStream will be cached, by this method. * So use this sparingly because it does increase the memory consumption. * * @param in InputStream to deserialize the object from. In will be read from * when a get or set is called next. After it is read the stream will be * closed. */ public void addResource(InputStream in) { addResourceObject(new Resource(in)); }
/** * Add a configuration resource. * * The properties of this resource will override properties of previously * added resources, unless they were marked <a href="#Final">final</a>. * * WARNING: The contents of the InputStream will be cached, by this method. * So use this sparingly because it does increase the memory consumption. * * @param in InputStream to deserialize the object from. In will be read from * when a get or set is called next. After it is read the stream will be * closed. */ public void addResource(InputStream in) { addResourceObject(new Resource(in)); }
public void addResource(Path file, boolean restrictedParser) { addResourceObject(new Resource(file, restrictedParser)); }
public void addResource(String name, boolean restrictedParser) { addResourceObject(new Resource(name, restrictedParser)); }
public void addResource(InputStream in, boolean restrictedParser) { addResourceObject(new Resource(in, restrictedParser)); }
public void addResource(URL url, boolean restrictedParser) { addResourceObject(new Resource(url, restrictedParser)); }
public Resource(Object resource, String name) { this(resource, name, getRestrictParserDefault(resource)); }
/** * Add a configuration resource. * * The properties of this resource will override properties of previously * added resources, unless they were marked <a href="#Final">final</a>. * * @param url url of the resource to be added, the local filesystem is * examined directly to find the resource, without referring to * the classpath. */ public void addResource(URL url) { addResourceObject(new Resource(url)); }