|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Objectorg.apache.avalon.framework.logger.AbstractLogEnabled
org.exist.cocoon.XMLDBSource
public class XMLDBSource
This class implements the xmldb:// pseudo-protocol and allows to get XML content from an XML:DB enabled XML database.
This class starts on XMLDBSource from Cocoon project. Some improvments may be useful for Cocoon, some others may be Exist specific. Interesting new features :
| Field Summary | |
|---|---|
Collection |
collection
|
String |
encoding
default encoding to write outputStream |
String |
password
The supplied password |
static String |
PREFIX
Source prefix |
Resource |
resource
|
static String |
URI
Source namespace |
String |
url
The requested URL |
String |
user
The supplied user |
| Constructor Summary | |
|---|---|
XMLDBSource(org.apache.avalon.framework.logger.Logger logger,
String user,
String password,
String srcUrl)
The constructor. |
|
| Method Summary | |
|---|---|
boolean |
canCancel(OutputStream stream)
Can the data sent to an OutputStream returned by
getOutputStream() be cancelled ? |
void |
cancel(OutputStream stream)
Cancel the data sent to an OutputStream returned by
getOutputStream(). |
String |
createId()
Create a new identifier for a resource within a collection. |
void |
delete()
Delete the source |
boolean |
exists()
|
OutputStream |
getBinaryOutputStream()
Return an OutputStream to write data to a binary resource. |
org.apache.excalibur.source.Source |
getChild(String name)
|
Collection |
getChildren()
|
Collection |
getCollection()
A getter for the xmldb Collection object for this Source |
Node |
getContentAsDOM()
get content as DOM |
long |
getContentLength()
|
String |
getEncoding()
Set a default encoding for outputStream |
InputStream |
getInputStream()
Get an InputSource for the given URL. |
long |
getLastModified()
|
String |
getMimeType()
|
String |
getName()
|
OutputStream |
getOutputStream()
Return an OutputStream to write to. |
org.apache.excalibur.source.Source |
getParent()
|
String |
getPassword()
A getter for the password configured in cocoon.xconf for the connection |
Resource |
getResource()
A getter for the xmldb Resource object for this Source |
String |
getScheme()
|
String |
getURI()
|
String |
getUser()
A getter for the user login configured in cocoon.xconf |
org.apache.excalibur.source.SourceValidity |
getValidity()
|
boolean |
isCollection()
|
void |
makeCollection()
|
void |
refresh()
|
void |
setContentAsDOM(Node doc)
set content as DOM |
void |
setEncoding(String s)
Set a default encoding for outputStream |
void |
toSAX(ContentHandler handler)
Stream SAX events to a given ContentHandler. |
| Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
|---|
enableLogging |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String URI
public static final String PREFIX
public String encoding
public String url
public String user
public String password
public Collection collection
public Resource resource
| Constructor Detail |
|---|
public XMLDBSource(org.apache.avalon.framework.logger.Logger logger,
String user,
String password,
String srcUrl)
logger - the Logger instance.user - password - srcUrl - the URL being queried.| Method Detail |
|---|
public Collection getCollection()
throws org.apache.excalibur.source.SourceException,
XMLDBException
org.apache.excalibur.source.SourceException
XMLDBException
public Resource getResource()
throws org.apache.excalibur.source.SourceException,
XMLDBException
org.apache.excalibur.source.SourceException
XMLDBExceptionpublic String getUser()
public String getPassword()
public void toSAX(ContentHandler handler)
throws SAXException
toSAX in interface org.apache.excalibur.xml.sax.XMLizableSAXExceptionpublic String getURI()
getURI in interface org.apache.excalibur.source.Sourcepublic long getContentLength()
getContentLength in interface org.apache.excalibur.source.Sourcepublic long getLastModified()
getLastModified in interface org.apache.excalibur.source.Sourcepublic boolean exists()
exists in interface org.apache.excalibur.source.Sourcepublic String getMimeType()
getMimeType in interface org.apache.excalibur.source.Sourcepublic String getScheme()
getScheme in interface org.apache.excalibur.source.Sourcepublic org.apache.excalibur.source.SourceValidity getValidity()
getValidity in interface org.apache.excalibur.source.Sourcepublic void refresh()
refresh in interface org.apache.excalibur.source.Source
public InputStream getInputStream()
throws IOException
getInputStream in interface org.apache.excalibur.source.SourceIOException
public OutputStream getOutputStream()
throws IOException,
MalformedURLException
OutputStream to write to. This method expects an XML document to be
written in that stream. To create a binary resource, use getBinaryOutputStream().
getOutputStream in interface org.apache.excalibur.source.ModifiableSourceIOException
MalformedURLException
public void setContentAsDOM(Node doc)
throws IOException,
MalformedURLException
IOException
MalformedURLException
public Node getContentAsDOM()
throws IOException,
MalformedURLException
IOException
MalformedURLException
public OutputStream getBinaryOutputStream()
throws IOException,
MalformedURLException
OutputStream to write data to a binary resource.
IOException
MalformedURLException
public String createId()
throws org.apache.excalibur.source.SourceException
org.apache.excalibur.source.SourceExceptionpublic void setEncoding(String s)
public String getEncoding()
public void delete()
throws org.apache.excalibur.source.SourceException
delete in interface org.apache.excalibur.source.ModifiableSourceorg.apache.excalibur.source.SourceExceptionpublic boolean canCancel(OutputStream stream)
OutputStream returned by
getOutputStream() be cancelled ?
canCancel in interface org.apache.excalibur.source.ModifiableSource
public void cancel(OutputStream stream)
throws IOException
OutputStream returned by
getOutputStream().
After cancelling, the stream should no longer be used.
cancel in interface org.apache.excalibur.source.ModifiableSourceIOException
public void makeCollection()
throws org.apache.excalibur.source.SourceException
makeCollection in interface org.apache.excalibur.source.ModifiableTraversableSourceorg.apache.excalibur.source.SourceExceptionpublic boolean isCollection()
isCollection in interface org.apache.excalibur.source.TraversableSource
public Collection getChildren()
throws org.apache.excalibur.source.SourceException
getChildren in interface org.apache.excalibur.source.TraversableSourceorg.apache.excalibur.source.SourceException
public org.apache.excalibur.source.Source getChild(String name)
throws org.apache.excalibur.source.SourceException
getChild in interface org.apache.excalibur.source.TraversableSourceorg.apache.excalibur.source.SourceExceptionpublic String getName()
getName in interface org.apache.excalibur.source.TraversableSource
public org.apache.excalibur.source.Source getParent()
throws org.apache.excalibur.source.SourceException
getParent in interface org.apache.excalibur.source.TraversableSourceorg.apache.excalibur.source.SourceException
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||