Class S3Store

java.lang.Object
com.axelor.file.store.s3.S3Store
All Implemented Interfaces:
Store

public class S3Store extends Object implements Store
  • Constructor Details

  • Method Details

    • getClient

      public io.minio.MinioClient getClient()
    • getBucketName

      public String getBucketName()
    • hasFile

      public boolean hasFile(String fileName)
      Description copied from interface: Store
      Checks if a file with the specified name exists in the store.
      Specified by:
      hasFile in interface Store
      Parameters:
      fileName - the name of the file to check for existence
      Returns:
      true if a file with the specified name exists, false otherwise
    • addFile

      public UploadedFile addFile(InputStream inputStream, String fileName)
      Description copied from interface: Store
      Adds a file to the store using the provided input stream and file name.
      Specified by:
      addFile in interface Store
      Parameters:
      inputStream - the input stream containing the file data
      fileName - the name of the file to be stored
      Returns:
      an UploadedFile object representing the details of the uploaded file
    • addFile

      public UploadedFile addFile(Path path, String fileName)
      Description copied from interface: Store
      Adds a file to the store using the specified file path and file name.
      Specified by:
      addFile in interface Store
      Parameters:
      path - the Path of the file to be added
      fileName - the name under which the file should be stored
      Returns:
      an UploadedFile object containing the details of the uploaded file
    • deleteFile

      public void deleteFile(String fileName)
      Description copied from interface: Store
      Deletes a file with the specified name from the store.
      Specified by:
      deleteFile in interface Store
      Parameters:
      fileName - the name of the file to be deleted
    • getPath

      public Path getPath(String fileName, boolean cache)
      Description copied from interface: Store
      Retrieves a Path representation of the specified file in the store.
      Specified by:
      getPath in interface Store
      Parameters:
      fileName - the name of the file whose path is to be retrieved
      cache - whether to use cached storage for retrieving the file path
      Returns:
      the Path object representing the storage location of the file
    • getStream

      public InputStream getStream(String fileName, boolean cache)
      Description copied from interface: Store
      Retrieves an input stream for the specified file.
      Specified by:
      getStream in interface Store
      Parameters:
      fileName - the name of the file to retrieve the input stream for
      cache - whether the file should be retrieved from a cached source
      Returns:
      an InputStream for the specified file
    • getStoreType

      public StoreType getStoreType()
      Description copied from interface: Store
      Retrieves the type of store being used.
      Specified by:
      getStoreType in interface Store
      Returns:
      the StoreType representing the type of storage
    • shutdown

      public void shutdown()
      Description copied from interface: Store
      Performs the necessary cleanup or resource release operations to gracefully shut down the storage.
      Specified by:
      shutdown in interface Store