org.exist.xmldb
Class LocalXMLResource

java.lang.Object
  extended by org.exist.xmldb.AbstractEXistResource
      extended by org.exist.xmldb.LocalXMLResource
All Implemented Interfaces:
EXistResource, Resource, XMLResource

public class LocalXMLResource
extends AbstractEXistResource
implements XMLResource

Local implementation of XMLResource.


Field Summary
 
Fields inherited from interface org.xmldb.api.modules.XMLResource
RESOURCE_TYPE
 
Constructor Summary
LocalXMLResource(Subject user, BrokerPool pool, LocalCollection parent, NodeProxy p)
           
LocalXMLResource(Subject user, BrokerPool pool, LocalCollection parent, XmldbURI did)
           
 
Method Summary
 void freeResources()
           
 Object getContent()
           
 Node getContentAsDOM()
           
 void getContentAsSAX(ContentHandler handler)
           
 long getContentLength()
           
 Date getCreationTime()
           
 DocumentType getDocType()
           
 String getDocumentId()
           
 String getId()
           
 Date getLastModificationTime()
           
 NodeProxy getNode()
           
 Collection getParentCollection()
           
 Permission getPermissions()
           
 String getResourceType()
           
 boolean getSAXFeature(String arg0)
           
 void setContent(Object obj)
          Sets the content for this resource.
 void setContentAsDOM(Node root)
           
 ContentHandler setContentAsSAX()
           
 void setDocType(DocumentType doctype)
           
 void setLexicalHandler(LexicalHandler handler)
           
 void setSAXFeature(String arg0, boolean arg1)
           
 
Methods inherited from class org.exist.xmldb.AbstractEXistResource
getMimeType, setMimeType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LocalXMLResource

public LocalXMLResource(Subject user,
                        BrokerPool pool,
                        LocalCollection parent,
                        XmldbURI did)
                 throws XMLDBException
Throws:
XMLDBException

LocalXMLResource

public LocalXMLResource(Subject user,
                        BrokerPool pool,
                        LocalCollection parent,
                        NodeProxy p)
                 throws XMLDBException
Throws:
XMLDBException
Method Detail

getContent

public Object getContent()
                  throws XMLDBException
Specified by:
getContent in interface Resource
Throws:
XMLDBException

getContentAsDOM

public Node getContentAsDOM()
                     throws XMLDBException
Specified by:
getContentAsDOM in interface XMLResource
Throws:
XMLDBException

getContentAsSAX

public void getContentAsSAX(ContentHandler handler)
                     throws XMLDBException
Specified by:
getContentAsSAX in interface XMLResource
Throws:
XMLDBException

getDocumentId

public String getDocumentId()
                     throws XMLDBException
Specified by:
getDocumentId in interface XMLResource
Throws:
XMLDBException

getId

public String getId()
             throws XMLDBException
Specified by:
getId in interface Resource
Throws:
XMLDBException

getParentCollection

public Collection getParentCollection()
                               throws XMLDBException
Specified by:
getParentCollection in interface Resource
Throws:
XMLDBException

getResourceType

public String getResourceType()
                       throws XMLDBException
Specified by:
getResourceType in interface Resource
Throws:
XMLDBException

getCreationTime

public Date getCreationTime()
                     throws XMLDBException
Specified by:
getCreationTime in interface EXistResource
Specified by:
getCreationTime in class AbstractEXistResource
Throws:
XMLDBException

getLastModificationTime

public Date getLastModificationTime()
                             throws XMLDBException
Specified by:
getLastModificationTime in interface EXistResource
Specified by:
getLastModificationTime in class AbstractEXistResource
Throws:
XMLDBException

getContentLength

public long getContentLength()
                      throws XMLDBException
Specified by:
getContentLength in interface EXistResource
Throws:
XMLDBException

setContent

public void setContent(Object obj)
                throws XMLDBException
Sets the content for this resource. If value is of type File, it is directly passed to the parser when Collection.storeResource is called. Otherwise the method tries to convert the value to String. Passing a File object should be preferred if the document is large. The file's content will not be loaded into memory but directly passed to a SAX parser.

Specified by:
setContent in interface Resource
Parameters:
obj - the content value to set for the resource.
Throws:
XMLDBException - with expected error codes.
ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.

setContentAsDOM

public void setContentAsDOM(Node root)
                     throws XMLDBException
Specified by:
setContentAsDOM in interface XMLResource
Throws:
XMLDBException

setContentAsSAX

public ContentHandler setContentAsSAX()
                               throws XMLDBException
Specified by:
setContentAsSAX in interface XMLResource
Throws:
XMLDBException

freeResources

public void freeResources()
                   throws XMLDBException
Specified by:
freeResources in interface EXistResource
Throws:
XMLDBException

getSAXFeature

public boolean getSAXFeature(String arg0)
                      throws SAXNotRecognizedException,
                             SAXNotSupportedException
Specified by:
getSAXFeature in interface XMLResource
Throws:
SAXNotRecognizedException
SAXNotSupportedException

setSAXFeature

public void setSAXFeature(String arg0,
                          boolean arg1)
                   throws SAXNotRecognizedException,
                          SAXNotSupportedException
Specified by:
setSAXFeature in interface XMLResource
Throws:
SAXNotRecognizedException
SAXNotSupportedException

getPermissions

public Permission getPermissions()
                          throws XMLDBException
Specified by:
getPermissions in interface EXistResource
Specified by:
getPermissions in class AbstractEXistResource
Throws:
XMLDBException

setLexicalHandler

public void setLexicalHandler(LexicalHandler handler)
Specified by:
setLexicalHandler in interface EXistResource
Overrides:
setLexicalHandler in class AbstractEXistResource

getNode

public NodeProxy getNode()
                  throws XMLDBException
Throws:
XMLDBException

getDocType

public DocumentType getDocType()
                        throws XMLDBException
Specified by:
getDocType in interface EXistResource
Overrides:
getDocType in class AbstractEXistResource
Throws:
XMLDBException

setDocType

public void setDocType(DocumentType doctype)
                throws XMLDBException
Specified by:
setDocType in interface EXistResource
Overrides:
setDocType in class AbstractEXistResource
Throws:
XMLDBException


Copyright (C) The eXist-db Project. All rights reserved.