Skip to content

Commit

Permalink
Fix/unquote etag header (#110)
Browse files Browse the repository at this point in the history
* fix log message

* remove quotes from etag headers

* remove extra )
  • Loading branch information
gedl authored Jul 12, 2024
1 parent 7e098d6 commit 6703b9d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ protected DownloadExecutionResult process(FileAcceptor<?> acceptor, FileSource f
result = processFileDoesNotExist(acceptor, fileSource, pathWritable);
}
LOG.info("A new file was" + (result.isNewFileDownloaded() ? "" : " not") + " downloaded");
LOG.info("Download is " + (!result.isSuccessful() ? "un" : "" + "successful"));
LOG.info("Download is " + (!result.isSuccessful() ? "un" : "") + "successful");
return result;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,8 @@ public Optional<MD5Checksum> existingFileMd5() {

try {
final HeadObjectResponse headObjectResponse = client.headObject(headObjectRequest);
return Optional.ofNullable(headObjectResponse.eTag()).map(m -> MD5Checksum.of(m));
return Optional.ofNullable(headObjectResponse.eTag())
.map(m -> MD5Checksum.of(m.replaceAll("\"", "")));
} catch (NoSuchKeyException e) {
return Optional.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public FileInfo fileInfo() {
Optional.ofNullable(metadata.get(TIMESTAMP_METADATA_KEY))
.map(m -> Instant.ofEpochMilli(Long.valueOf(m)))
.orElse(Instant.now()),
MD5Checksum.of(headObjectResponse.eTag()),
MD5Checksum.of(headObjectResponse.eTag().replaceAll("\"", "")),
size);
}

Expand Down

0 comments on commit 6703b9d

Please sign in to comment.