if (md5HashOfDataFile != null && uploadFile.equals(dataFile)) {
md5HashOfUploadFile = md5HashOfDataFile;
} else {
InputStream inputStream = new BufferedInputStream(new FileInputStream(uploadFile));
if (progressWatcher != null) {
inputStream = new ProgressMonitoredInputStream(inputStream, progressWatcher);
}
md5HashOfUploadFile = ServiceUtils.computeMD5Hash(inputStream);
}
s3Object.setMd5Hash(md5HashOfUploadFile);
if (!uploadFile.equals(dataFile)) {
// Compute the MD5 hash of the *original* file if upload file has been altered
// through encryption or gzipping, unless we have been provided with this hash.
if (md5HashOfDataFile == null) {
InputStream inputStream = new BufferedInputStream(new FileInputStream(dataFile));
if (progressWatcher != null) {
inputStream = new ProgressMonitoredInputStream(inputStream, progressWatcher);
}
md5HashOfDataFile = ServiceUtils.computeMD5Hash(inputStream);
}
s3Object.addMetadata(