Package org.craftercms.engine.store.s3
Class S3Object
java.lang.Object
org.craftercms.core.util.cache.impl.AbstractCachingAwareObject
org.craftercms.engine.store.s3.S3File
org.craftercms.engine.store.s3.S3Object
- All Implemented Interfaces:
org.craftercms.core.service.Content
,org.craftercms.core.store.impl.File
,org.craftercms.core.util.cache.CachingAwareObject
Represents an S3 object.
- Since:
- 3.1.4
- Author:
- jross, avasquez
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected long
The content length.protected Supplier
<InputStream> The actual contentprotected long
When the file was last modified.Fields inherited from class org.craftercms.engine.store.s3.S3File
bucketName, key
Fields inherited from class org.craftercms.core.util.cache.impl.AbstractCachingAwareObject
cachingTime, scope
-
Constructor Summary
ConstructorsConstructorDescriptionS3Object
(String bucketName, String key, long lastModified, long contentLength, Supplier<InputStream> contentSupplier) Main constructor. -
Method Summary
Methods inherited from class org.craftercms.engine.store.s3.S3File
getBucketName, getKey, getName, getPath, isDirectory, isFile
Methods inherited from class org.craftercms.core.util.cache.impl.AbstractCachingAwareObject
getCachingTime, getScope, setCachingTime, setKey, setScope
-
Field Details
-
lastModified
protected long lastModifiedWhen the file was last modified. -
contentLength
protected long contentLengthThe content length. -
contentSupplier
The actual content
-
-
Constructor Details
-
S3Object
public S3Object(String bucketName, String key, long lastModified, long contentLength, Supplier<InputStream> contentSupplier) Main constructor.- Parameters:
bucketName
- the S3 bucketkey
- the S3 keylastModified
- the last modified timestampcontentLength
- the content sizecontentSupplier
- an InputStream supplier for the content
-
-
Method Details
-
getLastModified
public long getLastModified()- Specified by:
getLastModified
in interfaceorg.craftercms.core.service.Content
-
getLength
public long getLength()- Specified by:
getLength
in interfaceorg.craftercms.core.service.Content
-
getInputStream
- Specified by:
getInputStream
in interfaceorg.craftercms.core.service.Content
-
toString
-