Package org.nuxeo.ecm.blob.s3
Class S3BlobProvider
java.lang.Object
org.nuxeo.ecm.core.blob.AbstractBlobProvider
org.nuxeo.ecm.core.blob.BlobStoreBlobProvider
org.nuxeo.ecm.blob.s3.S3BlobProvider
- All Implemented Interfaces:
S3ManagedTransfer
,BlobProvider
Blob provider that stores files in S3.
This blob provider supports transactional record mode.
- Since:
- 11.1
-
Nested Class Summary
Nested classes/interfaces inherited from class org.nuxeo.ecm.core.blob.BlobStoreBlobProvider
BlobStoreBlobProvider.AutoDeleteFileInputStream
-
Field Summary
Fields inherited from class org.nuxeo.ecm.core.blob.BlobStoreBlobProvider
DIGEST_KEY_STRATEGY, KEY_STRATEGY_PROPERTY, MANAGED_KEY_STRATEGY, store
Fields inherited from class org.nuxeo.ecm.core.blob.AbstractBlobProvider
blobProviderId, properties
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
Checks whether this blob provider allows direct download.boolean
Checks if the bucket exists (used in health check probes).void
close()
Closes this blob provider and releases resources that may be held by it.protected BlobStore
getBlobStore
(String blobProviderId, Map<String, String> properties) protected S3BlobStoreConfiguration
getConfiguration
(Map<String, String> properties) protected String
getContentDispositionHeader
(Blob blob, javax.servlet.http.HttpServletRequest servletRequest) protected String
getContentTypeHeader
(Blob blob) protected String
The digest algorithm to use for the default key strategy.getStatus
(ManagedBlob blob) Gets the status of a blob.Gets the name of the scroll to scroll the blobs of the underlying blob store.com.amazonaws.services.s3.transfer.TransferManager
Returns theTransferManager
.getURI
(ManagedBlob blob, BlobManager.UsageHint hint, javax.servlet.http.HttpServletRequest servletRequest) Gets anURI
for the content of a managed blob.protected URI
getURICloudFront
(String bucketKey, ManagedBlob blob, Date expiration, javax.servlet.http.HttpServletRequest servletRequest) protected URI
getURIS3
(String bucketKey, ManagedBlob blob, Date expiration, javax.servlet.http.HttpServletRequest servletRequest) long
lengthOfBlob
(ManagedBlob blob) Gets the blob length from the underlying s3 bucket.Methods inherited from class org.nuxeo.ecm.core.blob.BlobStoreBlobProvider
deleteBlob, fixupDigest, getBinaryGarbageCollector, getFile, getKeyStrategy, getStream, getStream, initialize, isValidKey, readBlob, stripBlobKeyPrefix, stripBlobKeyVersionSuffix, supportsSync, updateBlob, writeBlob, writeBlob
Methods inherited from class org.nuxeo.ecm.core.blob.AbstractBlobProvider
allowByteRange, getProperties, hasCreateFromKeyPermission, isColdStorageMode, isRecordMode, isTransactional, isTransient, supportsUserUpdate, supportsUserUpdateDefaultFalse, supportsUserUpdateDefaultTrue
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.ecm.core.blob.BlobProvider
canConvert, getAppLinks, getAvailableConversions, getBinaryManager, getThumbnail, isVersion, performsExternalAccessControl, readBlob
-
Field Details
-
STORE_SCROLL_NAME
- Since:
- 2023
- See Also:
-
config
-
-
Constructor Details
-
S3BlobProvider
public S3BlobProvider()
-
-
Method Details
-
getBlobStore
protected BlobStore getBlobStore(String blobProviderId, Map<String, String> properties) throws IOException- Specified by:
getBlobStore
in classBlobStoreBlobProvider
- Throws:
IOException
-
allowDirectDownload
public boolean allowDirectDownload()Description copied from interface:BlobProvider
Checks whether this blob provider allows direct download.- Specified by:
allowDirectDownload
in interfaceBlobProvider
- Overrides:
allowDirectDownload
in classBlobStoreBlobProvider
- Since:
- 2023.12
-
getConfiguration
protected S3BlobStoreConfiguration getConfiguration(Map<String, String> properties) throws IOException- Throws:
IOException
-
getTransferManager
public com.amazonaws.services.s3.transfer.TransferManager getTransferManager()Description copied from interface:S3ManagedTransfer
Returns theTransferManager
.- Specified by:
getTransferManager
in interfaceS3ManagedTransfer
-
close
public void close()Description copied from interface:BlobProvider
Closes this blob provider and releases resources that may be held by it.- Specified by:
close
in interfaceBlobProvider
-
getDigestAlgorithm
Description copied from class:BlobStoreBlobProvider
The digest algorithm to use for the default key strategy.- Specified by:
getDigestAlgorithm
in classBlobStoreBlobProvider
-
canAccessBucket
public boolean canAccessBucket()Checks if the bucket exists (used in health check probes). -
lengthOfBlob
Gets the blob length from the underlying s3 bucket.- Returns:
- the blob length or -1 if the blob does not exist in storage
- Throws:
IOException
- Since:
- 2023.9
-
getURI
public URI getURI(ManagedBlob blob, BlobManager.UsageHint hint, javax.servlet.http.HttpServletRequest servletRequest) throws IOException Description copied from interface:BlobProvider
Gets anURI
for the content of a managed blob.- Specified by:
getURI
in interfaceBlobProvider
- Parameters:
blob
- the managed blobhint
-BlobManager.UsageHint
servletRequest
- the servlet request, ornull
- Returns:
- the
URI
, ornull
if none available - Throws:
IOException
-
getURICloudFront
protected URI getURICloudFront(String bucketKey, ManagedBlob blob, Date expiration, javax.servlet.http.HttpServletRequest servletRequest) throws URISyntaxException - Throws:
URISyntaxException
-
getURIS3
protected URI getURIS3(String bucketKey, ManagedBlob blob, Date expiration, javax.servlet.http.HttpServletRequest servletRequest) throws URISyntaxException - Throws:
URISyntaxException
-
getContentTypeHeader
-
getContentDispositionHeader
-
getStatus
Description copied from interface:BlobProvider
Gets the status of a blob.- Specified by:
getStatus
in interfaceBlobProvider
- Parameters:
blob
- the blob- Throws:
IOException
-
getStoreScrollName
Description copied from class:BlobStoreBlobProvider
Gets the name of the scroll to scroll the blobs of the underlying blob store.- Specified by:
getStoreScrollName
in classBlobStoreBlobProvider
-