From ca558553303756fa959ab8875888969f9a2d8b64 Mon Sep 17 00:00:00 2001 From: Torsten Krause Date: Wed, 20 Nov 2024 11:40:39 +0100 Subject: [PATCH] MCR-3303 improce method name --- .../java/org/mycore/restapi/v2/MCRRestDerivateContents.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mycore-restapi/src/main/java/org/mycore/restapi/v2/MCRRestDerivateContents.java b/mycore-restapi/src/main/java/org/mycore/restapi/v2/MCRRestDerivateContents.java index f6c68d0487..2653608be8 100644 --- a/mycore-restapi/src/main/java/org/mycore/restapi/v2/MCRRestDerivateContents.java +++ b/mycore-restapi/src/main/java/org/mycore/restapi/v2/MCRRestDerivateContents.java @@ -252,7 +252,7 @@ private static int getUploadMemThreshold() { * @see RFC 3230 * @see RFC 45843 */ - 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 + ":"; @@ -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(); } @@ -339,7 +339,7 @@ public Response getFileOrDirectory(@Context UriInfo uriInfo, @Context HttpHeader content.setMimeType(context.getMimeType(mcrPath.getFileName().toString())); try { final List> 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())