|
uPortal 2.4.1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jasig.portal.utils.ResourceLoader
This utility provides methods for accessing resources. The methods generally use the classpath to find the resource if the requested URL isn't already specified as a fully-qualified URL string.
The methods of this class sort of replace the old UtiltiesBean.fixURI() method.
Constructor Summary | |
ResourceLoader()
|
Method Summary | |
static org.w3c.dom.Document |
getResourceAsDocument(java.lang.Class requestingClass,
java.lang.String resource)
Get the contents of a URL as an XML Document |
static java.io.File |
getResourceAsFile(java.lang.Class requestingClass,
java.lang.String resource)
Returns the requested resource as a File. |
static java.lang.String |
getResourceAsFileString(java.lang.Class requestingClass,
java.lang.String resource)
Returns the requested resource as a File string. |
static java.util.Properties |
getResourceAsProperties(java.lang.Class requestingClass,
java.lang.String resource)
Get the contents of a URL as a java.util.Properties object |
static org.xml.sax.InputSource |
getResourceAsSAXInputSource(java.lang.Class requestingClass,
java.lang.String resource)
Returns the requested resource as a SAX input source. |
static java.io.InputStream |
getResourceAsStream(java.lang.Class requestingClass,
java.lang.String resource)
Returns the requested resource as a stream. |
static java.lang.String |
getResourceAsString(java.lang.Class requestingClass,
java.lang.String resource)
Get the contents of a URL as a String |
static java.net.URL |
getResourceAsURL(java.lang.Class requestingClass,
java.lang.String resource)
Finds a resource with a given name. |
static java.lang.String |
getResourceAsURLString(java.lang.Class requestingClass,
java.lang.String resource)
Returns the requested resource as a URL string. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ResourceLoader()
Method Detail |
public static java.net.URL getResourceAsURL(java.lang.Class requestingClass, java.lang.String resource) throws ResourceMissingException
requestingClass
- the java.lang.Class object of the class that is attempting to load the resourceresource
- a String describing the full or partial URL of the resource to load
ResourceMissingException
public static java.lang.String getResourceAsURLString(java.lang.Class requestingClass, java.lang.String resource) throws ResourceMissingException
requestingClass
- the java.lang.Class object of the class that is attempting to load the resourceresource
- a String describing the full or partial URL of the resource to load
ResourceMissingException
public static java.io.File getResourceAsFile(java.lang.Class requestingClass, java.lang.String resource) throws ResourceMissingException
requestingClass
- the java.lang.Class object of the class that is attempting to load the resourceresource
- a String describing the full or partial URL of the resource to load
ResourceMissingException
public static java.lang.String getResourceAsFileString(java.lang.Class requestingClass, java.lang.String resource) throws ResourceMissingException
requestingClass
- the java.lang.Class object of the class that is attempting to load the resourceresource
- a String describing the full or partial URL of the resource to load
ResourceMissingException
public static java.io.InputStream getResourceAsStream(java.lang.Class requestingClass, java.lang.String resource) throws ResourceMissingException, java.io.IOException
requestingClass
- the java.lang.Class object of the class that is attempting to load the resourceresource
- a String describing the full or partial URL of the resource to load
ResourceMissingException
java.io.IOException
public static org.xml.sax.InputSource getResourceAsSAXInputSource(java.lang.Class requestingClass, java.lang.String resource) throws ResourceMissingException, java.io.IOException
requestingClass
- the java.lang.Class object of the class that is attempting to load the resourceresource
- a String describing the full or partial URL of the resource to load
ResourceMissingException
java.io.IOException
public static org.w3c.dom.Document getResourceAsDocument(java.lang.Class requestingClass, java.lang.String resource) throws ResourceMissingException, java.io.IOException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
requestingClass
- the java.lang.Class object of the class that is attempting to load the resourceresource
- a String describing the full or partial URL of the resource whose contents to load
ResourceMissingException
java.io.IOException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
public static java.util.Properties getResourceAsProperties(java.lang.Class requestingClass, java.lang.String resource) throws ResourceMissingException, java.io.IOException
requestingClass
- the java.lang.Class object of the class that is attempting to load the resourceresource
- a String describing the full or partial URL of the resource whose contents to load
ResourceMissingException
java.io.IOException
public static java.lang.String getResourceAsString(java.lang.Class requestingClass, java.lang.String resource) throws ResourceMissingException, java.io.IOException
requestingClass
- the java.lang.Class object of the class that is attempting to load the resourceresource
- a String describing the full or partial URL of the resource whose contents to load
ResourceMissingException
java.io.IOException
|
uPortal 2.4.1 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |