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
public class S3BlobProvider extends BlobStoreBlobProvider implements S3ManagedTransfer
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 Modifier and Type Field Description S3BlobStoreConfiguration
config
-
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
Constructors Constructor Description S3BlobProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canAccessBucket()
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)
protected String
getContentTypeHeader(Blob blob)
protected String
getDigestAlgorithm()
The digest algorithm to use for the default key strategy.BlobStatus
getStatus(ManagedBlob blob)
Gets the status of a blob.com.amazonaws.services.s3.transfer.TransferManager
getTransferManager()
Returns theTransferManager
.URI
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)
protected URI
getURIS3(String bucketKey, ManagedBlob blob, Date expiration)
-
Methods inherited from class org.nuxeo.ecm.core.blob.BlobStoreBlobProvider
deleteBlob, fixupDigest, getBinaryGarbageCollector, getBinaryManager, getFile, getKeyStrategy, getStream, getStream, initialize, readBlob, stripBlobKeyPrefix, supportsSync, updateBlob, writeBlob, writeBlob
-
Methods inherited from class org.nuxeo.ecm.core.blob.AbstractBlobProvider
allowByteRange, getProperties, hasCreateFromKeyPermission, 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, getThumbnail, isVersion, performsExternalAccessControl, readBlob
-
-
-
-
Field Detail
-
config
public S3BlobStoreConfiguration config
-
-
Constructor Detail
-
S3BlobProvider
public S3BlobProvider()
-
-
Method Detail
-
getBlobStore
protected BlobStore getBlobStore(String blobProviderId, Map<String,String> properties) throws IOException
- Specified by:
getBlobStore
in classBlobStoreBlobProvider
- Throws:
IOException
-
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
protected String 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).
-
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) throws URISyntaxException
- Throws:
URISyntaxException
-
getURIS3
protected URI getURIS3(String bucketKey, ManagedBlob blob, Date expiration) throws URISyntaxException
- Throws:
URISyntaxException
-
getContentTypeHeader
protected String getContentTypeHeader(Blob blob)
-
getContentDispositionHeader
protected String getContentDispositionHeader(Blob blob)
-
getStatus
public BlobStatus getStatus(ManagedBlob blob) throws IOException
Description copied from interface:BlobProvider
Gets the status of a blob.- Specified by:
getStatus
in interfaceBlobProvider
- Parameters:
blob
- the blob- Throws:
IOException
-
-