Package com.cis.gorecipe.service
Class S3ServiceImpl
java.lang.Object
com.cis.gorecipe.service.S3ServiceImpl
- All Implemented Interfaces:
S3Service
This service manages all interactions with GoRecipe's S3 bucket
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleandeleteFile(String fileName)getFileUrl(String fileName)uploadFile(String fileName, InputStream inputStream, String contentType)
-
Constructor Details
-
S3ServiceImpl
public S3ServiceImpl()
-
-
Method Details
-
uploadFile
public String uploadFile(String fileName, InputStream inputStream, String contentType) throws IOException- Specified by:
uploadFilein interfaceS3Service- Parameters:
fileName- the name of the image file being uploadedinputStream- the file being uploaded as a bytestreamcontentType- the MIME type of the file- Returns:
- the URL of the file that has been uploaded to S3
- Throws:
IOException
-
deleteFile
- Specified by:
deleteFilein interfaceS3Service- Parameters:
fileName- the name of the file to be deleted from the S3 bucket- Returns:
- whether the file was successfully deleted
-
getFileUrl
- Specified by:
getFileUrlin interfaceS3Service- Parameters:
fileName- the name of the file to be located- Returns:
- the URL of the file in the S3 bucket
-