I'm trying to find out how I can solve a situation: I have file of any format (it could be either txt or jpeg for example) and I upload this file to the bucket with AmazonS3 object
@Autowired
private AmazonS3 amazonS3;
private void uploadFile(final String bucket, final String key, final String fileName) {
File file = new File(fileName);
amazonS3.putObject(bucket, key, file);
}
Then I can get this file in this way:
S3Object s3Object = amazonS3.getObject(bucket, key);
And I wonder how I can compare that my file and file i downloaded from S3. Is there any code for comparing? Thx in advance.