/** * Get the contents of a URL as an XML Document, first trying to read the Document with * validation turned on, and falling back to reading it with validation turned off. * * @param requestingClass the java.lang.Class object of the class that is attempting to load the * resource * @param resource a String describing the full or partial URL of the resource whose contents to * load * @return the actual contents of the resource as an XML Document * @throws ResourceMissingException * @throws java.io.IOException * @throws javax.xml.parsers.ParserConfigurationException * @throws org.xml.sax.SAXException */ public static Document getResourceAsDocument(Class<?> requestingClass, String resource) throws ResourceMissingException, IOException, ParserConfigurationException, SAXException { // Default is non-validating... return getResourceAsDocument(requestingClass, resource, false); }
/** * Get the contents of a URL as an XML Document, first trying to read the Document with * validation turned on, and falling back to reading it with validation turned off. * * @param requestingClass the java.lang.Class object of the class that is attempting to load the * resource * @param resource a String describing the full or partial URL of the resource whose contents to * load * @return the actual contents of the resource as an XML Document * @throws ResourceMissingException * @throws java.io.IOException * @throws javax.xml.parsers.ParserConfigurationException * @throws org.xml.sax.SAXException */ public static Document getResourceAsDocument(Class<?> requestingClass, String resource) throws ResourceMissingException, IOException, ParserConfigurationException, SAXException { // Default is non-validating... return getResourceAsDocument(requestingClass, resource, false); }
public LDAPGroupStore() { Document config = null; try { config = ResourceLoader.getResourceAsDocument( this.getClass(), "/properties/groups/LDAPGroupStoreConfig.xml", true); } catch (IOException e) { throw new RuntimeException( "LDAPGroupStore: Unable to find configuration configuration document", e); } catch (ResourceMissingException e) { throw new RuntimeException( "LDAPGroupStore: Unable to find configuration configuration document", e); } catch (ParserConfigurationException e) { throw new RuntimeException( "LDAPGroupStore: Unable to parse configuration configuration document", e); } catch (SAXException e) { throw new RuntimeException( "LDAPGroupStore: Unable to parse configuration configuration document", e); } init(config); }
public LDAPGroupStore() { Document config = null; try { config = ResourceLoader.getResourceAsDocument( this.getClass(), "/properties/groups/LDAPGroupStoreConfig.xml", true); } catch (IOException e) { throw new RuntimeException( "LDAPGroupStore: Unable to find configuration configuration document", e); } catch (ResourceMissingException e) { throw new RuntimeException( "LDAPGroupStore: Unable to find configuration configuration document", e); } catch (ParserConfigurationException e) { throw new RuntimeException( "LDAPGroupStore: Unable to parse configuration configuration document", e); } catch (SAXException e) { throw new RuntimeException( "LDAPGroupStore: Unable to parse configuration configuration document", e); } init(config); }