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 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 |
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(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 propertiesIOException
void close()
Blob readBlob(BlobInfo blobInfo) throws IOException
Blob
from storage.blobInfo
- the blob informationIOException
String writeBlob(Blob blob) throws IOException
Blob
to storage and returns information about it.
Called to store a user-created blob.
blob
- the blobIOException
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 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(BlobInfo blobInfo)
blobInfo
- the blob information to be readtrue
if the provider performs security checks before reading a blob, false
otherwiseCopyright © 2018 Nuxeo. All rights reserved.