Package org.apache.ofbiz.base.config
Class ResourceLoader
- java.lang.Object
-
- org.apache.ofbiz.base.config.ResourceLoader
-
- Direct Known Subclasses:
FileLoader
,UrlLoader
public abstract class ResourceLoader extends java.lang.Object
Loads resources using dynamically specified resource loader classes.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
module
-
Constructor Summary
Constructors Modifier Constructor Description protected
ResourceLoader()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description java.lang.String
fullLocation(java.lang.String location)
Just a utility method to be used in loadResource by the implementing class.static ResourceLoader
getLoader(java.lang.String xmlFilename, java.lang.String loaderName)
abstract java.net.URL
getURL(java.lang.String location)
static java.net.URL
getURL(java.lang.String xmlFilename, java.lang.String location, java.lang.String loaderName)
static org.w3c.dom.Document
getXmlDocument(java.lang.String xmlFilename)
Deprecated.static org.w3c.dom.Element
getXmlRootElement(java.lang.String xmlFilename)
Deprecated.static void
invalidateDocument(java.lang.String xmlFilename)
abstract java.io.InputStream
loadResource(java.lang.String location)
static java.io.InputStream
loadResource(java.lang.String xmlFilename, java.lang.String location, java.lang.String loaderName)
static org.w3c.dom.Document
readXmlDocument(java.lang.String xmlFilename)
static org.w3c.dom.Element
readXmlRootElement(java.lang.String xmlFilename)
-
-
-
Method Detail
-
loadResource
public static java.io.InputStream loadResource(java.lang.String xmlFilename, java.lang.String location, java.lang.String loaderName) throws GenericConfigException
- Throws:
GenericConfigException
-
getURL
public static java.net.URL getURL(java.lang.String xmlFilename, java.lang.String location, java.lang.String loaderName) throws GenericConfigException
- Throws:
GenericConfigException
-
getLoader
public static ResourceLoader getLoader(java.lang.String xmlFilename, java.lang.String loaderName) throws GenericConfigException
- Throws:
GenericConfigException
-
getXmlRootElement
@Deprecated public static org.w3c.dom.Element getXmlRootElement(java.lang.String xmlFilename) throws GenericConfigException
Deprecated.This method should be avoided. DOM object trees take a lot of memory and they are not thread-safe, so they should not be cached.- Throws:
GenericConfigException
-
readXmlRootElement
public static org.w3c.dom.Element readXmlRootElement(java.lang.String xmlFilename) throws GenericConfigException
- Throws:
GenericConfigException
-
invalidateDocument
public static void invalidateDocument(java.lang.String xmlFilename)
-
getXmlDocument
@Deprecated public static org.w3c.dom.Document getXmlDocument(java.lang.String xmlFilename) throws GenericConfigException
Deprecated.This method should be avoided. DOM object trees take a lot of memory and they are not thread-safe, so they should not be cached.- Throws:
GenericConfigException
-
readXmlDocument
public static org.w3c.dom.Document readXmlDocument(java.lang.String xmlFilename) throws GenericConfigException
- Throws:
GenericConfigException
-
fullLocation
public java.lang.String fullLocation(java.lang.String location)
Just a utility method to be used in loadResource by the implementing class.- Parameters:
location
-- Returns:
- the built-up full location
-
loadResource
public abstract java.io.InputStream loadResource(java.lang.String location) throws GenericConfigException
- Throws:
GenericConfigException
-
getURL
public abstract java.net.URL getURL(java.lang.String location) throws GenericConfigException
- Throws:
GenericConfigException
-
-