Interface S3FileService

All Known Implementing Classes:
S3FileServiceimpl

public interface S3FileService
  • Method Details

    • createFile

      String createFile(S3File s3File)
      Creates a file in S3 with server-side encryption.
      Parameters:
      s3File - the file to create. The file must be non null, have a non-null InputStream.
      Returns:
      the generated id for the file.
      Throws:
      IllegalArgumentException - if the S3File is not valid.
      IllegalStateException - if the file does not successfully transfer to S3
    • retrieveFile

      S3File retrieveFile(String id)
      Retrieves a file from S3.
      Parameters:
      id - the id for the file. Cannot be blank.
      Returns:
      the file in S3. Any available metadata will from S3 will be included in the metadata. This metadata may differ from the metadata used to create the file. Will return null if the object does not exist.
      Throws:
      IllegalArgumentException - if the id is blank.
      IllegalStateException - if the file does not successfully transfer from S3
    • updateFile

      void updateFile(S3File s3File)
      Updates a file in S3 with server-side encryption.
      Parameters:
      s3File - the file to update. The file must be non null, have a non-null InputStream, and an existing id.
      Throws:
      IllegalArgumentException - if the S3File is not valid.
      IllegalStateException - if the file does not successfully transfer to S3 or if the file does not exist in s3
    • deleteFile

      void deleteFile(String id)
      Delete a file in S3.
      Parameters:
      id - the id for the file. Cannot be blank.
      Throws:
      IllegalArgumentException - if the id is blank.
      IllegalStateException - if the file does not successfully delete in S3