Interface BlobProvider
-
- All Known Subinterfaces:
LiveConnectBlobProvider<O>
- All Known Implementing Classes:
AbstractBlobProvider
,AbstractCloudBinaryManager
,AbstractLiveConnectBlobProvider
,AESBlobProvider
,AzureBinaryManager
,AzureBlobProvider
,AzureCDNBinaryManager
,BinaryBlobProvider
,BlobStoreBlobProvider
,BoxBlobProvider
,CloudFrontBinaryManager
,FilesystemBlobProvider
,GoogleDriveBlobProvider
,GoogleStorageBinaryManager
,GoogleStorageBlobProvider
,GridFSBinaryManager
,GridFSBlobProvider
,InMemoryBlobProvider
,LocalBlobProvider
,S3BinaryManager
,S3BlobProvider
public interface BlobProvider
Interface for a provider ofBlob
s, which knows how to read and write them.- Since:
- 7.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
allowByteRange()
Checks whether this blob provider allows byte ranges in keys.default boolean
allowDirectDownload()
Checks whether this blob provider allows direct download.default boolean
canConvert(ManagedBlob blob, String mimeType)
Checks if the conversion to the givenmimeType
is supported by theblob
.void
close()
Closes this blob provider and releases resources that may be held by it.default void
deleteBlob(BlobContext blobContext)
Deletes a blob from storage.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 correspondingURI
for a managed blob.default BinaryGarbageCollector
getBinaryGarbageCollector()
Gets the associated garbage collector, if any.default BinaryManager
getBinaryManager()
Gets the associated binary manager, if any.default File
getFile(ManagedBlob blob)
Gets aFile
(if one exists) for the data of a managed blob.Map<String,String>
getProperties()
Returns the properties of the blob provider.default BlobStatus
getStatus(ManagedBlob blob)
Gets the status of a blob.default InputStream
getStream(String blobKey, ByteRange byteRange)
Gets anInputStream
for a byte range of a managed blob.default InputStream
getStream(ManagedBlob blob)
Gets anInputStream
for the data of a managed blob.default InputStream
getThumbnail(ManagedBlob blob)
Gets anInputStream
for a thumbnail of a managed blob.default URI
getURI(ManagedBlob blob, BlobManager.UsageHint hint, javax.servlet.http.HttpServletRequest servletRequest)
Gets anURI
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
isColdStorageMode()
Checks whether this blob provider uses "cold storage mode".default boolean
isRecordMode()
Checks whether this blob provider uses "record mode".default boolean
isTransactional()
Checks whether this blob provider is transactional.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 aBlob
from storage.default Blob
readBlob(BlobInfoContext blobInfoContext)
Reads aBlob
from storage.default boolean
supportsSync()
Checks if sync is supported.boolean
supportsUserUpdate()
Checks if user update is supported.default void
updateBlob(BlobUpdateContext blobUpdateContext)
Updates a blob's properties in storage.String
writeBlob(Blob blob)
Writes aBlob
to storage and returns information about it.default String
writeBlob(BlobContext blobContext)
Writes aBlob
to storage and returns information about it.
-
-
-
Method Detail
-
initialize
void initialize(String blobProviderId, Map<String,String> properties) throws IOException
Initializes the blob provider.- Parameters:
blobProviderId
- the blob provider id for this binary managerproperties
- initialization properties- Throws:
IOException
- Since:
- 7.3
-
close
void close()
Closes this blob provider and releases resources that may be held by it.- Since:
- 7.3
-
isColdStorageMode
default boolean isColdStorageMode()
Checks whether this blob provider uses "cold storage mode".Cold storage mode has the following characteristics:
- transactional (blobs aren't actually written/deleted until the transaction commits, and transaction rollback is possible)
- Since:
- 2021.19
-
isRecordMode
default boolean isRecordMode()
Checks whether this blob provider uses "record mode".Record mode has the following characteristics:
- transactional (blobs aren't actually written/deleted until the transaction commits, and transaction rollback is possible),
- can replace or delete a document's blob.
- Since:
- 11.1
-
isTransactional
default boolean isTransactional()
Checks whether this blob provider is transactional.A transactional blob provider only writes blobs to final storage at commit time.
- Since:
- 11.1
-
isTransient
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.- Since:
- 10.1
-
allowByteRange
default boolean allowByteRange()
Checks whether this blob provider allows byte ranges in keys.- Since:
- 11.1
-
allowDirectDownload
default boolean allowDirectDownload()
Checks whether this blob provider allows direct download.- Since:
- 2023.7
-
readBlob
default Blob readBlob(BlobInfoContext blobInfoContext) throws IOException
Reads aBlob
from storage.- Parameters:
blobInfoContext
- the blob information context- Returns:
- the blob
- Throws:
IOException
- Since:
- 11.1
-
readBlob
Blob readBlob(BlobInfo blobInfo) throws IOException
Reads aBlob
from storage.- Parameters:
blobInfo
- the blob information- Returns:
- the blob
- Throws:
IOException
-
writeBlob
default String writeBlob(BlobContext blobContext) throws IOException
Writes aBlob
to storage and returns information about it.Called to store a user-created blob.
- Parameters:
blobContext
- the blob context- Returns:
- the blob key
- Throws:
IOException
- Since:
- 11.1
-
writeBlob
String writeBlob(Blob blob) throws IOException
Writes aBlob
to storage and returns information about it.Called to store a user-created blob.
- Parameters:
blob
- the blob- Returns:
- the blob key
- Throws:
IOException
- Since:
- 9.2
-
updateBlob
default void updateBlob(BlobUpdateContext blobUpdateContext) throws IOException
Updates a blob's properties in storage.- Parameters:
blobUpdateContext
- the blob update context- Throws:
IOException
- Since:
- 11.1
-
deleteBlob
default void deleteBlob(BlobContext blobContext)
Deletes a blob from storage. Only meaningful for a record blob provider.- Parameters:
blobContext
- the blob context- Since:
- 11.1
- See Also:
isRecordMode()
-
getStatus
default BlobStatus getStatus(ManagedBlob blob) throws IOException
Gets the status of a blob.- Parameters:
blob
- the blob- Throws:
IOException
- Since:
- 11.1
-
supportsUserUpdate
boolean supportsUserUpdate()
Checks if user update is supported.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).
- Returns:
true
if user update is supported- Since:
- 7.10
-
supportsSync
default boolean supportsSync()
Checks if sync is supported.Sync refers to the fact that a blob from this provider may be synced with a remote system (like Nuxeo Drive) or with a process that updates things in the blob (like Binary Metadata, or WOPI).
- Returns:
true
if sync is supported- Since:
- 11.1
-
getStream
default InputStream getStream(String blobKey, ByteRange byteRange) throws IOException
Gets anInputStream
for a byte range of a managed blob.- Parameters:
blobKey
- the blob keybyteRange
- the byte range- Returns:
- the stream
- Throws:
IOException
- Since:
- 11.1
-
getStream
default InputStream getStream(ManagedBlob blob) throws IOException
Gets anInputStream
for the data of a managed blob.Like all
InputStream
, the result must be closed when done with it to avoid resource leaks.- Parameters:
blob
- the managed blob- Returns:
- the stream
- Throws:
IOException
- Since:
- 7.3
-
getFile
default File getFile(ManagedBlob blob)
Gets aFile
(if one exists) for the data of a managed blob.- Parameters:
blob
- the managed blob- Returns:
- the file, or
null
if no underlying file is available - Since:
- 11.1
-
getThumbnail
default InputStream getThumbnail(ManagedBlob blob) throws IOException
Gets anInputStream
for a thumbnail of a managed blob.Like all
InputStream
, the result must be closed when done with it to avoid resource leaks.- Parameters:
blob
- the managed blob- Returns:
- the stream
- Throws:
IOException
- Since:
- 7.3
-
getURI
default URI getURI(ManagedBlob blob, BlobManager.UsageHint hint, javax.servlet.http.HttpServletRequest servletRequest) throws IOException
Gets anURI
for the content of a managed blob.- Parameters:
blob
- the managed blobhint
-BlobManager.UsageHint
servletRequest
- the servlet request, ornull
- Returns:
- the
URI
, ornull
if none available - Throws:
IOException
- Since:
- 7.4
-
getAvailableConversions
default Map<String,URI> getAvailableConversions(ManagedBlob blob, BlobManager.UsageHint hint) throws IOException
Gets a map of available MIME type conversions and correspondingURI
for a managed blob.- Parameters:
blob
- the managed blobhint
-BlobManager.UsageHint
- Returns:
- a map of MIME types and
URI
, which may be empty - Throws:
IOException
- Since:
- 7.3
-
canConvert
default boolean canConvert(ManagedBlob blob, String mimeType)
Checks if the conversion to the givenmimeType
is supported by theblob
.- Parameters:
blob
- the managed blobmimeType
- the destination mime type- Returns:
true
if this managed blob supports the conversion to the given mime type- Since:
- 10.1
-
isVersion
default boolean isVersion(ManagedBlob blob)
Returns true if version of the blob is a version.- Parameters:
blob
- the managed blob- Returns:
- true if the blob is a version or a revision
- Since:
- 7.3
-
getAppLinks
default List<AppLink> getAppLinks(String user, ManagedBlob blob) throws IOException
Returns a list of application links for the given blob.- Throws:
IOException
- Since:
- 7.3
-
getBinaryManager
default BinaryManager getBinaryManager()
Gets the associated binary manager, if any.- Returns:
- the binary manager, or
null
- Since:
- 7.4
-
getBinaryGarbageCollector
default BinaryGarbageCollector getBinaryGarbageCollector()
Gets the associated garbage collector, if any.- Returns:
- the garbage collector, or
null
- Since:
- 11.1
-
performsExternalAccessControl
default boolean performsExternalAccessControl(BlobInfo blobInfo)
Checks if the blob provider performs external access control checks.- Parameters:
blobInfo
- the blob information to be read- Returns:
true
if the provider performs security checks before reading a blob,false
otherwise- Since:
- 8.4
-
getProperties
Map<String,String> getProperties()
Returns the properties of the blob provider.- Since:
- 10.2
-
hasCreateFromKeyPermission
default boolean hasCreateFromKeyPermission()
Checks if current user has the rights to create blobs in the blob provider using a key.- Since:
- 10.2
-
-