java.lang.Object
de.iip_ecosphere.platform.deviceMgt.s3mock.S3Storage
All Implemented Interfaces:
de.iip_ecosphere.platform.deviceMgt.storage.Storage
Direct Known Subclasses:
S3PackageStorage

public class S3Storage extends Object implements de.iip_ecosphere.platform.deviceMgt.storage.Storage
A S3Storage grants access to the storage through S3. For this purpose it uses an Amazon S3 Client to communicate with the S3 storage. The storage can be set to a fixed prefix, so it is only working with a subset of the bucket.
Author:
Dennis Pidun, University of Hildesheim, Holger Eichelberger, SSE
  • Field Details

    • prefix

      private String prefix
    • client

      private com.amazonaws.services.s3.AmazonS3 client
    • bucket

      private String bucket
  • Constructor Details

    • S3Storage

      public S3Storage(String prefix, com.amazonaws.services.s3.AmazonS3 client, String bucket)
      Creates a S3Storage.
      Parameters:
      prefix - the prefix to lock on
      client - the connected client
      bucket - the bucket
  • Method Details

    • getPrefix

      public String getPrefix()
      Specified by:
      getPrefix in interface de.iip_ecosphere.platform.deviceMgt.storage.Storage
    • list

      public Set<String> list()
      Specified by:
      list in interface de.iip_ecosphere.platform.deviceMgt.storage.Storage
    • generateDownloadUrl

      public String generateDownloadUrl(String key)
      Specified by:
      generateDownloadUrl in interface de.iip_ecosphere.platform.deviceMgt.storage.Storage
    • storeFile

      public void storeFile(String key, File file) throws IOException
      Specified by:
      storeFile in interface de.iip_ecosphere.platform.deviceMgt.storage.Storage
      Throws:
      IOException