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
BlobHolder
implementation based on aDocumentModel
and a XPath.- Author:
- tiry
-
-
Constructor Summary
Constructors Modifier Constructor Description DocumentBlobHolder(DocumentModel doc, String xPath)
protected
DocumentBlobHolder(DocumentModel doc, String xPath, List<Blob> blobList)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DocumentBlobHolder
asDirectBlobHolder(int index)
Returns a newDocumentBlobHolder
for the blob at the givenindex
wheregetBlob()
andgetXpath()
will return information about the blob.protected List<Property>
computeBlobList()
Computes the blob list, with the main blob first.protected String
getBasePath()
Blob
getBlob()
Returns the Blob held inside the object.List<Blob>
getBlobs()
Returns a list of blobs, if holder implementation supports multiple blobs.DocumentModel
getDocument()
protected String
getFullXPath(Property property)
Gets the full xpath for a property, including schema prefix in all cases.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.String
getXpath()
void
setBlob(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:
getBasePath
in classAbstractBlobHolder
-
getBlob
public Blob getBlob()
Description copied from interface:BlobHolder
Returns the Blob held inside the object.
-
setBlob
public void setBlob(Blob blob)
Description copied from interface:BlobHolder
Sets a blob in the object.The underlying document must be saved by the caller.
- Specified by:
setBlob
in interfaceBlobHolder
- Overrides:
setBlob
in classAbstractBlobHolder
-
getModificationDate
public Calendar getModificationDate()
Description copied from interface:BlobHolder
Returns the held blob modification date.
-
getHash
public String getHash()
Description copied from interface:BlobHolder
Returns a hash for the held blob.- Specified by:
getHash
in interfaceBlobHolder
- Overrides:
getHash
in classAbstractBlobHolder
-
getProperty
public Serializable getProperty(String name)
Description copied from interface:BlobHolder
Returns a named property.
-
getProperties
public Map<String,Serializable> getProperties()
Description copied from interface:BlobHolder
Returns all properties as a Map.
-
getBlobs
public List<Blob> getBlobs()
Description copied from interface:BlobHolder
Returns a list of blobs, if holder implementation supports multiple blobs.- Specified by:
getBlobs
in interfaceBlobHolder
- Overrides:
getBlobs
in classAbstractBlobHolder
-
asDirectBlobHolder
public DocumentBlobHolder asDirectBlobHolder(int index) throws IndexOutOfBoundsException
Returns a newDocumentBlobHolder
for the blob at the givenindex
wheregetBlob()
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
-
-