public interface BlobProvider
Blob
s, which knows how to read and write them.Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this blob provider and releases resources that may be held by it.
|
default ManagedBlob |
freezeVersion(ManagedBlob blob,
Document doc)
Returns a new managed blob pointing to a fixed version of the original blob.
|
default List<AppLink> |
getAppLinks(String user,
ManagedBlob blob)
Returns a list of application links for the given blob.
|
default Map<String,URI> |
getAvailableConversions(ManagedBlob blob,
BlobManager.UsageHint hint)
Gets a map of available MIME type conversions and corresponding
URI for a managed blob. |
default BinaryManager |
getBinaryManager()
Gets the associated binary manager, if any.
|
default InputStream |
getConvertedStream(ManagedBlob blob,
String mimeType,
DocumentModel doc)
Gets an
InputStream for a conversion to the given MIME type. |
default InputStream |
getStream(ManagedBlob blob)
Gets an
InputStream for the data of a managed blob. |
default InputStream |
getThumbnail(ManagedBlob blob)
Gets an
InputStream for a thumbnail of a managed blob. |
default URI |
getURI(ManagedBlob blob,
BlobManager.UsageHint hint,
javax.servlet.http.HttpServletRequest servletRequest)
Gets an
URI for the content of a managed blob. |
void |
initialize(String blobProviderId,
Map<String,String> properties)
Initializes the blob provider.
|
default boolean |
isVersion(ManagedBlob blob)
Returns true if version of the blob is a version.
|
default boolean |
performsExternalAccessControl(BlobManager.BlobInfo blobInfo)
Checks if the blob provider performs external access control checks.
|
Blob |
readBlob(BlobManager.BlobInfo blobInfo)
Reads a
Blob from storage. |
boolean |
supportsUserUpdate()
Checks if user update is supported.
|
String |
writeBlob(Blob blob,
Document doc)
Writes a
Blob to storage and returns information about it. |
void initialize(String blobProviderId, Map<String,String> properties) throws IOException
blobProviderId
- the blob provider id for this binary managerproperties
- initialization propertiesIOException
void close()
Blob readBlob(BlobManager.BlobInfo blobInfo) throws IOException
Blob
from storage.blobInfo
- the blob informationIOException
String writeBlob(Blob blob, Document doc) throws IOException
Blob
to storage and returns information about it.
Called to store a user-created blob.
blob
- the blobdoc
- the document to which this blob belongsIOException
boolean supportsUserUpdate()
A user update refers to the fact that a blob from this provider may be overwritten with another blob, wherever the original blob may occur (usually in a document property).
true
if user update is supporteddefault InputStream getStream(ManagedBlob blob) throws IOException
InputStream
for the data of a managed blob.
Like all InputStream
, the result must be closed when done with it to avoid resource leaks.
blob
- the managed blobIOException
default InputStream getThumbnail(ManagedBlob blob) throws IOException
InputStream
for a thumbnail of a managed blob.
Like all InputStream
, the result must be closed when done with it to avoid resource leaks.
blob
- the managed blobIOException
default URI getURI(ManagedBlob blob, BlobManager.UsageHint hint, javax.servlet.http.HttpServletRequest servletRequest) throws IOException
URI
for the content of a managed blob.blob
- the managed blobhint
- BlobManager.UsageHint
servletRequest
- the servlet request, or null
URI
, or null
if none availableIOException
default Map<String,URI> getAvailableConversions(ManagedBlob blob, BlobManager.UsageHint hint) throws IOException
URI
for a managed blob.blob
- the managed blobhint
- BlobManager.UsageHint
URI
, which may be emptyIOException
default InputStream getConvertedStream(ManagedBlob blob, String mimeType, DocumentModel doc) throws IOException
InputStream
for a conversion to the given MIME type.
Like all InputStream
, the result must be closed when done with it to avoid resource leaks.
blob
- the managed blobmimeType
- the MIME type to convert todoc
- the document that holds the blobnull
if no conversion is available for the given MIME typeIOException
default ManagedBlob freezeVersion(ManagedBlob blob, Document doc) throws IOException
blob
- the original managed blobdoc
- the document that holds the blobnull
if no change is neededIOException
default boolean isVersion(ManagedBlob blob)
blob
- the managed blobdefault List<AppLink> getAppLinks(String user, ManagedBlob blob) throws IOException
IOException
default BinaryManager getBinaryManager()
null
default boolean performsExternalAccessControl(BlobManager.BlobInfo blobInfo)
blobInfo
- the blob information to be readtrue
if the provider performs security checks before reading a blob, false
otherwiseCopyright © 2016 Nuxeo SA. All rights reserved.