public class DocumentBlobHolder extends AbstractBlobHolder
BlobHolder
implementation based on a DocumentModel
and a XPath.Modifier and Type | Field and Description |
---|---|
protected List<Blob> |
blobList |
protected DocumentModel |
doc |
protected String |
xPath |
Modifier | Constructor and Description |
---|---|
|
DocumentBlobHolder(DocumentModel doc,
String xPath) |
protected |
DocumentBlobHolder(DocumentModel doc,
String xPath,
List<Blob> blobList) |
Modifier and Type | Method and Description |
---|---|
DocumentBlobHolder |
asDirectBlobHolder(int index)
Returns a new
DocumentBlobHolder for the blob at the given index where getBlob() and
getXpath() 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.
|
getFilePath, getMD5Digest
protected final DocumentModel doc
public DocumentBlobHolder(DocumentModel doc, String xPath)
protected DocumentBlobHolder(DocumentModel doc, String xPath, List<Blob> blobList)
protected String getBasePath()
getBasePath
in class AbstractBlobHolder
public Blob getBlob()
BlobHolder
getBlob
in interface BlobHolder
getBlob
in class AbstractBlobHolder
public void setBlob(Blob blob)
BlobHolder
The underlying document must be saved by the caller.
setBlob
in interface BlobHolder
setBlob
in class AbstractBlobHolder
public Calendar getModificationDate()
BlobHolder
getModificationDate
in interface BlobHolder
getModificationDate
in class AbstractBlobHolder
public String getHash()
BlobHolder
getHash
in interface BlobHolder
getHash
in class AbstractBlobHolder
public Serializable getProperty(String name)
BlobHolder
public Map<String,Serializable> getProperties()
BlobHolder
public List<Blob> getBlobs()
BlobHolder
getBlobs
in interface BlobHolder
getBlobs
in class AbstractBlobHolder
public DocumentBlobHolder asDirectBlobHolder(int index) throws IndexOutOfBoundsException
DocumentBlobHolder
for the blob at the given index
where getBlob()
and
getXpath()
will return information about the blob.index
- the blob indexIndexOutOfBoundsException
- if the index is invalidprotected List<Property> computeBlobList()
protected String getFullXPath(Property property)
public DocumentModel getDocument()
Copyright © 2018 Nuxeo. All rights reserved.