Skip to content

Commit

Permalink
Add javadocs
Browse files Browse the repository at this point in the history
  • Loading branch information
bseeger committed Apr 12, 2024
1 parent 4a4ac76 commit 5861883
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/main/java/formflow/library/file/S3CloudFileRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ public void upload(String filePath, MultipartFile file) {
}
}

/**
* Retrieves a file from S3.
*
* @param filepath The path of the file
* @return CloudFile containing file, file size, and metadata about the file.
*/
public CloudFile get(String filepath) {
try {
log.info("Getting file at filepath {} from S3", filepath);
Expand All @@ -110,6 +116,12 @@ public CloudFile get(String filepath) {
}
}

/**
* Deletes a file from S3 storage.
*
* @param filepath The path of the file to delete
* @throws SdkClientException
*/
public void delete(String filepath) throws SdkClientException {
log.info("Deleting file at filepath {} from S3", filepath);
s3Client.deleteObject(new DeleteObjectRequest(bucketName, filepath));
Expand Down

0 comments on commit 5861883

Please sign in to comment.