Interface StorageClient

All Superinterfaces:
AutoCloseable
All Known Implementing Classes:
GcsStorageClient, S3StorageClient

public interface StorageClient extends AutoCloseable
Interface for cloud storage operations. Implementations provide access to S3-compatible storage, GCS, or other cloud storage systems.
  • Method Details

    • uploadObject

      void uploadObject(String objectName, InputStream inputStream, long size, String contentType)
      Uploads an object to storage.
      Parameters:
      objectName - the name/path for the object
      inputStream - the input stream of data to upload
      size - the size of the data in bytes
      contentType - the MIME type of the content
    • downloadObject

      void downloadObject(String objectName, OutputStream outputStream)
      Downloads an object from storage.
      Parameters:
      objectName - the name/path of the object to download
      outputStream - the output stream to write data to
    • deleteObject

      void deleteObject(String objectName)
      Deletes an object from storage.
      Parameters:
      objectName - the name/path of the object to delete
    • listObjects

      List<StorageItem> listObjects(String prefix, int maxItems)
      Lists objects in storage with the given prefix.
      Parameters:
      prefix - the path prefix to list objects under (null or empty for root)
      maxItems - maximum number of items to return
      Returns:
      list of storage items
    • getObjectTags

      Map<String,String> getObjectTags(String objectName)
      Gets tags/metadata for an object.
      Parameters:
      objectName - the name/path of the object
      Returns:
      map of tag key-value pairs
    • setObjectTags

      void setObjectTags(String objectName, Map<String,String> tags)
      Sets tags/metadata for an object.
      Parameters:
      objectName - the name/path of the object
      tags - the tags to set
    • ensureBucketExists

      void ensureBucketExists()
      Ensures the bucket exists, creating it if necessary.
    • isAvailable

      boolean isAvailable()
      Checks if storage is properly configured and accessible.
      Returns:
      true if storage is available
    • close

      void close()
      Closes the client and releases resources.
      Specified by:
      close in interface AutoCloseable