public interface BlobProvider
Blobs, which knows how to read and write them.| Modifier and Type | Method and Description |
|---|---|
default boolean |
canConvert(ManagedBlob blob,
String mimeType)
Checks if the conversion to the given
mimeType is supported by the blob. |
void |
close()
Closes this blob provider and releases resources that may be held by it.
|
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.
|
Map<String,String> |
getProperties()
Returns the properties of the blob provider.
|
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. |
default boolean |
hasCreateFromKeyPermission()
Checks if current user has the rights to create blobs in the blob provider using a key.
|
void |
initialize(String blobProviderId,
Map<String,String> properties)
Initializes the blob provider.
|
default boolean |
isTransient()
Checks whether this blob provider is transient: blobs may disappear after a while, so a caller should not rely on
them being available forever.
|
default boolean |
isVersion(ManagedBlob blob)
Returns true if version of the blob is a version.
|
default boolean |
performsExternalAccessControl(BlobInfo blobInfo)
Checks if the blob provider performs external access control checks.
|
Blob |
readBlob(BlobInfo blobInfo)
Reads a
Blob from storage. |
boolean |
supportsUserUpdate()
Checks if user update is supported.
|
String |
writeBlob(Blob blob)
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 propertiesIOExceptionvoid close()
default boolean isTransient()
Blob readBlob(BlobInfo blobInfo) throws IOException
Blob from storage.blobInfo - the blob informationIOExceptionString writeBlob(Blob blob) throws IOException
Blob to storage and returns information about it.
Called to store a user-created blob.
blob - the blobIOExceptionboolean 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 blobIOExceptiondefault 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 blobIOExceptiondefault 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.UsageHintservletRequest - the servlet request, or nullURI, or null if none availableIOExceptiondefault Map<String,URI> getAvailableConversions(ManagedBlob blob, BlobManager.UsageHint hint) throws IOException
URI for a managed blob.blob - the managed blobhint - BlobManager.UsageHintURI, which may be emptyIOExceptiondefault boolean canConvert(ManagedBlob blob, String mimeType)
mimeType is supported by the blob.blob - the managed blobmimeType - the destination mime typetrue if this managed blob supports the conversion to the given mime typedefault boolean isVersion(ManagedBlob blob)
blob - the managed blobdefault List<AppLink> getAppLinks(String user, ManagedBlob blob) throws IOException
IOExceptiondefault BinaryManager getBinaryManager()
nulldefault boolean performsExternalAccessControl(BlobInfo blobInfo)
blobInfo - the blob information to be readtrue if the provider performs security checks before reading a blob, false otherwiseMap<String,String> getProperties()
default boolean hasCreateFromKeyPermission()
Copyright © 2019 Nuxeo. All rights reserved.