Skip to content

Commit

Permalink
MCR-3303 improce method name
Browse files Browse the repository at this point in the history
  • Loading branch information
toKrause committed Nov 20, 2024
1 parent b243c5e commit ca55855
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ private static int getUploadMemThreshold() {
* @see <a href="https://tools.ietf.org/html/rfc3230">RFC 3230</a>
* @see <a href="https://tools.ietf.org/html/rfc5843">RFC 45843</a>
*/
private static String getDigestHeader(MCRDigest digest) {
private static String getReprDigestHeaderValue(MCRDigest digest) {
final String algorithm = digest.getAlgorithm().toLowerCase();
final String encodedValue = Base64.getEncoder().encodeToString(digest.toBytes());
return algorithm + "=:" + encodedValue + ":";
Expand Down Expand Up @@ -299,7 +299,7 @@ public Response getFileOrDirectoryMetadata() {
.lastModified(Date.from(fileAttributes.lastModifiedTime().toInstant()))
.header(HttpHeaders.CONTENT_LENGTH, fileAttributes.size())
.tag(getETag(fileAttributes))
.header("Repr-Digest", getDigestHeader(fileAttributes.digest()))
.header("Repr-Digest", getReprDigestHeaderValue(fileAttributes.digest()))
.build();
}

Expand Down Expand Up @@ -339,7 +339,7 @@ public Response getFileOrDirectory(@Context UriInfo uriInfo, @Context HttpHeader
content.setMimeType(context.getMimeType(mcrPath.getFileName().toString()));
try {
final List<Map.Entry<String, String>> responseHeader = List
.of(Map.entry("Repr-Digest", getDigestHeader(fileAttributes.digest())));
.of(Map.entry("Repr-Digest", getReprDigestHeaderValue(fileAttributes.digest())));
return MCRRestContentHelper.serveContent(content, uriInfo, requestHeader, responseHeader);
} catch (IOException e) {
throw MCRErrorResponse.fromStatus(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode())
Expand Down

0 comments on commit ca55855

Please sign in to comment.