Skip to content

Commit

Permalink
The bitstream is removed from the S3 and local assetstore
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmajchrak committed Dec 18, 2023
1 parent 906ddb4 commit 9275741
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,18 @@ public void put(Bitstream bitstream, InputStream in) throws IOException {
}
}
}

@Override
public void remove(Bitstream bitstream) throws IOException {
String key = getFullKey(bitstream.getInternalId());
try {
// Remove file from S3
s3Service.deleteObject(getBucketName(), key);
// Remove file from local assetstore
dsBitStoreService.remove(bitstream);
} catch (AmazonClientException e) {
log.error("remove(" + key + ")", e);
throw new IOException(e);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public class S3BitStoreService extends BaseBitStoreService {
/**
* S3 service
*/
private AmazonS3 s3Service = null;
protected AmazonS3 s3Service = null;

/**
* S3 transfer manager
Expand Down

0 comments on commit 9275741

Please sign in to comment.