Class S3ServiceImpl

java.lang.Object
com.cis.gorecipe.service.S3ServiceImpl
All Implemented Interfaces:
S3Service

@Service public class S3ServiceImpl extends Object implements S3Service
This service manages all interactions with GoRecipe's S3 bucket
  • Constructor Details

    • S3ServiceImpl

      public S3ServiceImpl()
  • Method Details

    • uploadFile

      public String uploadFile(String fileName, InputStream inputStream, String contentType) throws IOException
      Specified by:
      uploadFile in interface S3Service
      Parameters:
      fileName - the name of the image file being uploaded
      inputStream - the file being uploaded as a bytestream
      contentType - the MIME type of the file
      Returns:
      the URL of the file that has been uploaded to S3
      Throws:
      IOException
    • deleteFile

      public boolean deleteFile(String fileName)
      Specified by:
      deleteFile in interface S3Service
      Parameters:
      fileName - the name of the file to be deleted from the S3 bucket
      Returns:
      whether the file was successfully deleted
    • getFileUrl

      public String getFileUrl(String fileName)
      Specified by:
      getFileUrl in interface S3Service
      Parameters:
      fileName - the name of the file to be located
      Returns:
      the URL of the file in the S3 bucket