Class DocumentBlobHolder
- java.lang.Object
-
- org.nuxeo.ecm.core.api.blobholder.AbstractBlobHolder
-
- org.nuxeo.ecm.core.api.blobholder.DocumentBlobHolder
-
- All Implemented Interfaces:
BlobHolder
- Direct Known Subclasses:
DocumentStringBlobHolder,MailMessageBlobHolder,PictureBlobHolder,PictureBookBlobHolder
public class DocumentBlobHolder extends AbstractBlobHolder
BlobHolderimplementation based on aDocumentModeland a XPath.- Author:
- tiry
-
-
Constructor Summary
Constructors Modifier Constructor Description DocumentBlobHolder(DocumentModel doc, String xPath)protectedDocumentBlobHolder(DocumentModel doc, String xPath, List<Blob> blobList)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DocumentBlobHolderasDirectBlobHolder(int index)Returns a newDocumentBlobHolderfor the blob at the givenindexwheregetBlob()andgetXpath()will return information about the blob.protected List<Property>computeBlobList()Computes the blob list, with the main blob first.protected StringgetBasePath()BlobgetBlob()Returns the Blob held inside the object.List<Blob>getBlobs()Returns a list of blobs, if holder implementation supports multiple blobs.DocumentModelgetDocument()protected StringgetFullXPath(Property property)Gets the full xpath for a property, including schema prefix in all cases.StringgetHash()Returns a hash for the held blob.CalendargetModificationDate()Returns the held blob modification date.Map<String,Serializable>getProperties()Returns all properties as a Map.SerializablegetProperty(String name)Returns a named property.StringgetXpath()voidsetBlob(Blob blob)Sets a blob in the object.-
Methods inherited from class org.nuxeo.ecm.core.api.blobholder.AbstractBlobHolder
getFilePath, getMD5Digest
-
-
-
-
Field Detail
-
doc
protected final DocumentModel doc
-
xPath
protected final String xPath
-
-
Constructor Detail
-
DocumentBlobHolder
public DocumentBlobHolder(DocumentModel doc, String xPath)
-
DocumentBlobHolder
protected DocumentBlobHolder(DocumentModel doc, String xPath, List<Blob> blobList)
-
-
Method Detail
-
getBasePath
protected String getBasePath()
- Specified by:
getBasePathin classAbstractBlobHolder
-
getBlob
public Blob getBlob()
Description copied from interface:BlobHolderReturns the Blob held inside the object.
-
setBlob
public void setBlob(Blob blob)
Description copied from interface:BlobHolderSets a blob in the object.The underlying document must be saved by the caller.
- Specified by:
setBlobin interfaceBlobHolder- Overrides:
setBlobin classAbstractBlobHolder
-
getModificationDate
public Calendar getModificationDate()
Description copied from interface:BlobHolderReturns the held blob modification date.
-
getHash
public String getHash()
Description copied from interface:BlobHolderReturns a hash for the held blob.- Specified by:
getHashin interfaceBlobHolder- Overrides:
getHashin classAbstractBlobHolder
-
getProperty
public Serializable getProperty(String name)
Description copied from interface:BlobHolderReturns a named property.
-
getProperties
public Map<String,Serializable> getProperties()
Description copied from interface:BlobHolderReturns all properties as a Map.
-
getBlobs
public List<Blob> getBlobs()
Description copied from interface:BlobHolderReturns a list of blobs, if holder implementation supports multiple blobs.- Specified by:
getBlobsin interfaceBlobHolder- Overrides:
getBlobsin classAbstractBlobHolder
-
asDirectBlobHolder
public DocumentBlobHolder asDirectBlobHolder(int index) throws IndexOutOfBoundsException
Returns a newDocumentBlobHolderfor the blob at the givenindexwheregetBlob()andgetXpath()will return information about the blob.- Parameters:
index- the blob index- Returns:
- the new blob holder
- Throws:
IndexOutOfBoundsException- if the index is invalid- Since:
- 9.3
-
computeBlobList
protected List<Property> computeBlobList()
Computes the blob list, with the main blob first.- Returns:
- the blob properties
- Since:
- 9.3
-
getFullXPath
protected String getFullXPath(Property property)
Gets the full xpath for a property, including schema prefix in all cases.- Since:
- 9.3
-
getXpath
public String getXpath()
- Since:
- 7.3
-
getDocument
public DocumentModel getDocument()
- Since:
- 7.4
-
-