|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ResourceManager
This is the main interface a resource manager must implement. A resource manager key is a path-like string, locating a resource. For example: /config/text.xml /pages/icon.gif Resources Manager could store resource in flat files (see FlatFileResourceManagerImpl), in relational databases (see DBResourceManagerImpl) or in an application dependent way.
Method Summary | |
---|---|
boolean |
canWrite(String key)
Indicates if the resource manager implementation suports write operations |
boolean |
exists(String key)
Check if a resource exists given its key. |
Node |
getContentAsDOM(String key)
Gets a W3C DOM node for the specified key. |
org.dom4j.Document |
getContentAsDOM4J(String key)
Gets a DOM4J document for the specified key. |
void |
getContentAsSAX(String key,
ContentHandler handler)
Gets a document form the resource manager and send SAX events to the specified content handler. |
void |
getContentAsSAX(String key,
ContentHandler handler,
boolean validating,
boolean handleXInclude)
Gets a document form the resource manager and send SAX events to the specified content handler. |
InputStream |
getContentAsStream(String key)
Returns a binary input stream for the specified key. |
OutputStream |
getOutputStream(String key)
Allows writing to the resource |
String |
getRealPath(String key)
Returns the path to the given resource on the file system. |
ContentHandler |
getWriteContentHandler(String key)
Returns a ContentHandler that can write to the Resource Manager |
Writer |
getWriter(String key)
Allow writing to the resource |
XMLReader |
getXMLReader()
Returns a XMLReader interface to the resource manager. |
long |
lastModified(String key,
boolean doNotThrowResourceNotFound)
Gets the last modified timestamp for the specified resource |
int |
length(String key)
Returns the length of the file denoted by this abstract pathname. |
Method Detail |
---|
Node getContentAsDOM(String key)
key
- A Resource Manager key
org.dom4j.Document getContentAsDOM4J(String key)
key
- A Resource Manager key
void getContentAsSAX(String key, ContentHandler handler)
key
- A Resource Manager keyhandler
- The content handler where SAX events are sentvoid getContentAsSAX(String key, ContentHandler handler, boolean validating, boolean handleXInclude)
key
- A Resource Manager keyhandler
- The content handler where SAX events are sentvalidating
- Whether the XML parser must attempt to validate the resourcehandleXInclude
- Whether the XML parser must process XInclude instructionsInputStream getContentAsStream(String key)
key
- A Resource Manager key
XMLReader getXMLReader()
setContentHandler() and parse(String key)
- Returns:
- An XML reader
long lastModified(String key, boolean doNotThrowResourceNotFound)
key
- A Resource Manager keydoNotThrowResourceNotFound
-
int length(String key)
boolean canWrite(String key)
key
- A Resource Manager key
ContentHandler getWriteContentHandler(String key)
key
- A Resource Manager key
OutputStream getOutputStream(String key)
key
- A Resource Manager key
Writer getWriter(String key)
key
- A Resource Manager key
String getRealPath(String key)
boolean exists(String key)
key
- A Resource Manager key
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |