|
|||||||||
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. |
org.dom4j.Document |
getContentAsDOM4J(String key,
XMLUtils.ParserConfiguration parserConfiguration,
boolean handleLexical)
Gets a DOM4J document for the specified key. |
void |
getContentAsSAX(String key,
XMLReceiver xmlReceiver)
Gets a document form the resource manager and send SAX events to the specified receiver. |
void |
getContentAsSAX(String key,
XMLReceiver xmlReceiver,
XMLUtils.ParserConfiguration parserConfiguration,
boolean handleLexical)
Gets a document form the resource manager and send SAX events to the specified receiver. |
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. |
XMLReceiver |
getWriteContentHandler(String key)
Returns a receiver 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
org.dom4j.Document getContentAsDOM4J(String key, XMLUtils.ParserConfiguration parserConfiguration, boolean handleLexical)
key
- a Resource Manager keyparserConfiguration
- parser configurationhandleLexical
- whether the XML parser must output SAX LexicalHandler events, including comments @return a document elementvoid getContentAsSAX(String key, XMLReceiver xmlReceiver)
key
- a Resource Manager keyxmlReceiver
- receiver where SAX events are sentvoid getContentAsSAX(String key, XMLReceiver xmlReceiver, XMLUtils.ParserConfiguration parserConfiguration, boolean handleLexical)
key
- a Resource Manager keyxmlReceiver
- receiver where SAX events are sentparserConfiguration
- parser configurationhandleLexical
- whether the XML parser must output SAX LexicalHandler events, including commentsInputStream 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
XMLReceiver 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 |