org.exist.xmldb
Class LocalBinaryResource

java.lang.Object
  extended by org.exist.xmldb.AbstractEXistResource
      extended by org.exist.xmldb.LocalBinaryResource
All Implemented Interfaces:
EXistResource, ExtendedResource, Resource, BinaryResource

public class LocalBinaryResource
extends AbstractEXistResource
implements ExtendedResource, BinaryResource, EXistResource

Author:
wolf

Field Summary
 
Fields inherited from interface org.xmldb.api.modules.BinaryResource
RESOURCE_TYPE
 
Constructor Summary
LocalBinaryResource(Subject user, BrokerPool pool, LocalCollection collection, XmldbURI docId)
           
 
Method Summary
 void freeResources()
           
 Object getContent()
           
 void getContentIntoAFile(File tmpfile)
          It saves the resource to the local file given as input parameter.
 void getContentIntoAStream(OutputStream os)
          It saves the resource to the local stream given as input parameter.
 long getContentLength()
           
 Date getCreationTime()
           
 Object getExtendedContent()
          It returns an object representing the content, in the representation which needs less memory.
 String getId()
           
 Date getLastModificationTime()
           
 String getMimeType()
           
 Collection getParentCollection()
           
 Permission getPermissions()
           
 String getResourceType()
           
 InputStream getStreamContent()
          It returns an stream to the content, whichever it is its origin
 long getStreamLength()
          It returns the length of the content, whichever it is its origin
 void setContent(Object value)
           
 
Methods inherited from class org.exist.xmldb.AbstractEXistResource
getDocType, setDocType, setLexicalHandler, setMimeType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.exist.xmldb.EXistResource
getDocType, setDocType, setLexicalHandler, setMimeType
 

Constructor Detail

LocalBinaryResource

public LocalBinaryResource(Subject user,
                           BrokerPool pool,
                           LocalCollection collection,
                           XmldbURI docId)
Method Detail

getParentCollection

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

getId

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

getResourceType

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

getExtendedContent

public Object getExtendedContent()
                          throws XMLDBException
Description copied from interface: ExtendedResource
It returns an object representing the content, in the representation which needs less memory.

Specified by:
getExtendedContent in interface ExtendedResource
Throws:
XMLDBException

getContent

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

setContent

public void setContent(Object value)
                throws XMLDBException
Specified by:
setContent in interface Resource
Throws:
XMLDBException

getStreamContent

public InputStream getStreamContent()
                             throws XMLDBException
Description copied from interface: ExtendedResource
It returns an stream to the content, whichever it is its origin

Specified by:
getStreamContent in interface ExtendedResource
Throws:
XMLDBException

getContentIntoAFile

public void getContentIntoAFile(File tmpfile)
                         throws XMLDBException
Description copied from interface: ExtendedResource
It saves the resource to the local file given as input parameter. Do NOT confuse with set content.

Specified by:
getContentIntoAFile in interface ExtendedResource
Throws:
XMLDBException

getContentIntoAStream

public void getContentIntoAStream(OutputStream os)
                           throws XMLDBException
Description copied from interface: ExtendedResource
It saves the resource to the local stream given as input parameter. Do NOT confuse with set content.

Specified by:
getContentIntoAStream in interface ExtendedResource
Throws:
XMLDBException

freeResources

public void freeResources()
Specified by:
freeResources in interface EXistResource

getStreamLength

public long getStreamLength()
                     throws XMLDBException
Description copied from interface: ExtendedResource
It returns the length of the content, whichever it is its origin

Specified by:
getStreamLength in interface ExtendedResource
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

getMimeType

public String getMimeType()
                   throws XMLDBException
Specified by:
getMimeType in interface EXistResource
Overrides:
getMimeType in class AbstractEXistResource
Throws:
XMLDBException

getPermissions

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

getContentLength

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


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