Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.ecm.core.api.blobholder
Class DocumentBlobHolder

java.lang.Object
  extended by org.nuxeo.ecm.core.api.blobholder.AbstractBlobHolder
      extended by org.nuxeo.ecm.core.api.blobholder.DocumentBlobHolder
All Implemented Interfaces:
BlobHolder
Direct Known Subclasses:
DocumentStringBlobHolder, PictureBlobHolder, PictureBookBlobHolder

public class DocumentBlobHolder
extends AbstractBlobHolder

BlobHolder implementation based on a DocumentModel and a XPath.

Author:
tiry

Constructor Summary
DocumentBlobHolder(DocumentModel doc, String xPath)
           
DocumentBlobHolder(DocumentModel doc, String xPath, String xPathFilename)
          Constructor with filename property for compatibility (when filename was not stored on blob object)
 
Method Summary
 Blob getBlob()
          Returns the Blob held inside the object.
 List<Blob> getBlobs()
          Returns a list of blobs, if holder implementation supports multiple blobs.
 String getHash()
          Returns a hash for the held blob.
 Calendar getModificationDate()
          Returns the held blob modification date.
 Map<String,Serializable> getProperties()
          Returns all properties as a Map.
 Serializable getProperty(String name)
          Returns a named property.
 void setBlob(Blob blob)
          Sets a blob in the object.
 
Methods inherited from class org.nuxeo.ecm.core.api.blobholder.AbstractBlobHolder
getFilePath
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DocumentBlobHolder

public DocumentBlobHolder(DocumentModel doc,
                          String xPath,
                          String xPathFilename)
Constructor with filename property for compatibility (when filename was not stored on blob object)


DocumentBlobHolder

public DocumentBlobHolder(DocumentModel doc,
                          String xPath)
Method Detail

getBlob

public Blob getBlob()
             throws ClientException
Description copied from interface: BlobHolder
Returns the Blob held inside the object.

Specified by:
getBlob in interface BlobHolder
Specified by:
getBlob in class AbstractBlobHolder
Throws:
ClientException

setBlob

public void setBlob(Blob blob)
             throws ClientException
Description copied from interface: BlobHolder
Sets a blob in the object.

The underlying document must be saved by the caller.

Specified by:
setBlob in interface BlobHolder
Overrides:
setBlob in class AbstractBlobHolder
Throws:
ClientException

getModificationDate

public Calendar getModificationDate()
                             throws ClientException
Description copied from interface: BlobHolder
Returns the held blob modification date.

Specified by:
getModificationDate in interface BlobHolder
Specified by:
getModificationDate in class AbstractBlobHolder
Throws:
ClientException

getHash

public String getHash()
               throws ClientException
Description copied from interface: BlobHolder
Returns a hash for the held blob.

Specified by:
getHash in interface BlobHolder
Overrides:
getHash in class AbstractBlobHolder
Throws:
ClientException

getProperty

public Serializable getProperty(String name)
                         throws ClientException
Description copied from interface: BlobHolder
Returns a named property.

Throws:
ClientException

getProperties

public Map<String,Serializable> getProperties()
Description copied from interface: BlobHolder
Returns all properties as a Map.


getBlobs

public List<Blob> getBlobs()
                    throws ClientException
Description copied from interface: BlobHolder
Returns a list of blobs, if holder implementation supports multiple blobs.

Specified by:
getBlobs in interface BlobHolder
Overrides:
getBlobs in class AbstractBlobHolder
Throws:
ClientException

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.