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

public class S3Object extends S3File implements org.craftercms.core.service.Content
Represents an S3 object.
Since:
3.1.4
Author:
jross, avasquez
  • Field Details

    • lastModified

      protected long lastModified
      When the file was last modified.
    • contentLength

      protected long contentLength
      The content length.
    • contentSupplier

      protected Supplier<InputStream> 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 bucket
      key - the S3 key
      lastModified - the last modified timestamp
      contentLength - the content size
      contentSupplier - an InputStream supplier for the content
  • Method Details

    • getLastModified

      public long getLastModified()
      Specified by:
      getLastModified in interface org.craftercms.core.service.Content
    • getLength

      public long getLength()
      Specified by:
      getLength in interface org.craftercms.core.service.Content
    • getInputStream

      public InputStream getInputStream()
      Specified by:
      getInputStream in interface org.craftercms.core.service.Content
    • toString

      public String toString()
      Overrides:
      toString in class S3File