From 4c69f0f8b8f6f80839fc0b603f19e17664f11d62 Mon Sep 17 00:00:00 2001 From: Nathan Buckingham Date: Fri, 6 Sep 2024 13:06:53 -0400 Subject: [PATCH] 117797: Change about method to new signature --- .../bitstore/JCloudBitStoreService.java | 26 ++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/dspace-api/src/main/java/org/dspace/storage/bitstore/JCloudBitStoreService.java b/dspace-api/src/main/java/org/dspace/storage/bitstore/JCloudBitStoreService.java index 773649e75cb..f7496100ca1 100644 --- a/dspace-api/src/main/java/org/dspace/storage/bitstore/JCloudBitStoreService.java +++ b/dspace-api/src/main/java/org/dspace/storage/bitstore/JCloudBitStoreService.java @@ -11,6 +11,8 @@ import java.io.IOException; import java.io.InputStream; import java.sql.SQLException; +import java.util.HashMap; +import java.util.List; import java.util.Map; import java.util.Properties; @@ -347,34 +349,34 @@ public static String getMIMEType(final Bitstream bitstream) { } } - @Override @SuppressWarnings("unchecked") - public Map about(Bitstream bitstream, Map attrs) throws IOException { + public Map about(Bitstream bitstream, List attrs) throws IOException { File file = getFile(bitstream); BlobStore blobStore = blobStoreContext.getBlobStore(); BlobMetadata blobMetadata = blobStore.blobMetadata(getContainer(), file.toString()); + Map metadata = new HashMap<>(); if (blobMetadata != null) { ContentMetadata contentMetadata = blobMetadata.getContentMetadata(); if (contentMetadata != null) { - attrs.put("size_bytes", String.valueOf(contentMetadata.getContentLength())); + metadata.put("size_bytes", String.valueOf(contentMetadata.getContentLength())); final HashCode hashCode = contentMetadata.getContentMD5AsHashCode(); if (hashCode != null) { - attrs.put("checksum", Utils.toHex(contentMetadata.getContentMD5AsHashCode().asBytes())); - attrs.put("checksum_algorithm", CSA); + metadata.put("checksum", Utils.toHex(contentMetadata.getContentMD5AsHashCode().asBytes())); + metadata.put("checksum_algorithm", CSA); } - attrs.put("modified", String.valueOf(blobMetadata.getLastModified().getTime())); + metadata.put("modified", String.valueOf(blobMetadata.getLastModified().getTime())); - attrs.put("ContentDisposition", contentMetadata.getContentDisposition()); - attrs.put("ContentEncoding", contentMetadata.getContentEncoding()); - attrs.put("ContentLanguage", contentMetadata.getContentLanguage()); - attrs.put("ContentType", contentMetadata.getContentType()); + metadata.put("ContentDisposition", contentMetadata.getContentDisposition()); + metadata.put("ContentEncoding", contentMetadata.getContentEncoding()); + metadata.put("ContentLanguage", contentMetadata.getContentLanguage()); + metadata.put("ContentType", contentMetadata.getContentType()); if (contentMetadata.getExpires() != null) { - attrs.put("Expires", contentMetadata.getExpires().getTime()); + metadata.put("Expires", contentMetadata.getExpires().getTime()); } } - return attrs; + return metadata; } return null; }