Class StorageClient

java.lang.Object
io.antmedia.storage.StorageClient
Direct Known Subclasses:
AmazonS3StorageClient, GCPStorageClient

public abstract class StorageClient extends Object
  • Field Details

    • BEAN_NAME

      public static final String BEAN_NAME
      See Also:
    • endpoint

      private String endpoint
      Endpoint for the storage, it's optional and it's used in some platforms like Digital Ocean, Wasabi, OVH
    • accessKey

      private String accessKey
      Access key to access the storage
    • secretKey

      private String secretKey
      Secret key for the storage
    • region

      private String region
      The region of the storage. It's like us-west-1 in S3
    • storageName

      private String storageName
      Name of the storage. It's bucketname for S3
    • permission

      private String permission
      Permission of the file that is uploaded to the Storage. It may differ according to the implemenation. Default value is public-read
    • cacheControl

      private String cacheControl
      Cache control policy for the file that is uploaded to the Storage. It may differ according to the implemenation. Default value is no-store, no-cache, must-revalidate, max-age=0
    • enabled

      private boolean enabled
    • storageClass

      private String storageClass
      Storage type. In S3 there is standard, glacier, etc.
    • progressListener

      protected com.amazonaws.event.ProgressListener progressListener
    • pathStyleAccessEnabled

      private boolean pathStyleAccessEnabled
    • transferBufferSize

      private int transferBufferSize
  • Constructor Details

    • StorageClient

      public StorageClient()
  • Method Details

    • delete

      public abstract void delete(String key)
      Delete file from storage
      Parameters:
      fileName -
      type -
    • save

      public abstract void save(String key, InputStream inputStream, boolean waitForCompletion)
      Save input stream to the storage with key parameter
      Parameters:
      key -
      inputStream -
    • save

      public abstract void save(String key, File file, boolean deleteLocalFile)
      Save file to storage and delete the local file according to the parameter
      Parameters:
      key -
      file -
      deleteLocalFile -
    • setProgressListener

      public void setProgressListener(com.amazonaws.event.ProgressListener progressListener)
    • save

      public void save(String key, File file)
      Save file to storage and delete the local file
      Parameters:
      key -
      file -
    • fileExist

      public abstract boolean fileExist(String key)
      Check if the key exists in the bucket
      Parameters:
      key -
      Returns:
    • reset

      public abstract void reset()
      Re-initialize the storage client with the current parameters
    • getEndpoint

      public String getEndpoint()
    • setEndpoint

      public void setEndpoint(String endpoint)
    • getAccessKey

      public String getAccessKey()
    • setAccessKey

      public void setAccessKey(String accessKey)
    • getSecretKey

      public String getSecretKey()
    • setSecretKey

      public void setSecretKey(String secretKey)
    • getRegion

      public String getRegion()
    • setRegion

      public void setRegion(String region)
    • getStorageName

      public String getStorageName()
    • setStorageName

      public void setStorageName(String storageName)
    • setPermission

      public void setPermission(String permission)
    • getPermission

      public String getPermission()
    • isEnabled

      public boolean isEnabled()
    • setEnabled

      public void setEnabled(boolean enabled)
    • setStorageClass

      public void setStorageClass(String storageClass)
    • getStorageClass

      public String getStorageClass()
    • getCacheControl

      public String getCacheControl()
    • setCacheControl

      public void setCacheControl(String cacheControl)
    • setPathStyleAccessEnabled

      public void setPathStyleAccessEnabled(boolean enabled)
    • isPathStyleAccessEnabled

      public boolean isPathStyleAccessEnabled()
    • getTransferBufferSize

      public int getTransferBufferSize()
    • setTransferBufferSize

      public void setTransferBufferSize(int transferBufferSize)