|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
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 |
Node |
getContentAsDOM(String key)
Gets a W3C DOM node for the specified key. |
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)
Gets the last modified timestamp for the specofoed resource |
int |
length(String key)
Returns the length of the file denoted by this abstract pathname. |
Method Detail |
public Node getContentAsDOM(String key)
key
- A Resource Manager key
public Document getContentAsDOM4J(String key)
key
- A Resource Manager key
public void getContentAsSAX(String key, ContentHandler handler)
key
- A Resource Manager keyhandler
- The content handler where SAX events are sentpublic void 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 instructionspublic InputStream getContentAsStream(String key)
key
- A Resource Manager key
public XMLReader getXMLReader()
setContentHandler() and parse(String key)
- Returns:
- An XML reader
public long lastModified(String key)
key
- A Resource Manager key
public int length(String key)
public boolean canWrite(String key)
key
- A Resource Manager key
public ContentHandler getWriteContentHandler(String key)
key
- A Resource Manager key
public OutputStream getOutputStream(String key)
key
- A Resource Manager key
public Writer getWriter(String key)
key
- A Resource Manager key
public String getRealPath(String key)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |