From 155c3e44a7b3b6eab47257d6f81486fb83cacb68 Mon Sep 17 00:00:00 2001 From: Gary Tierney Date: Wed, 31 Jul 2024 10:05:13 +0100 Subject: [PATCH] Include S3 object content type in attributes --- .../edu/illinois/library/cantaloupe/source/S3Source.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/edu/illinois/library/cantaloupe/source/S3Source.java b/src/main/java/edu/illinois/library/cantaloupe/source/S3Source.java index 93db8621f..c31ddb497 100644 --- a/src/main/java/edu/illinois/library/cantaloupe/source/S3Source.java +++ b/src/main/java/edu/illinois/library/cantaloupe/source/S3Source.java @@ -29,11 +29,7 @@ import java.nio.file.AccessDeniedException; import java.nio.file.NoSuchFileException; import java.time.Instant; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.Map; -import java.util.NoSuchElementException; +import java.util.*; /** *

Maps an identifier to an Amazon @@ -326,6 +322,7 @@ private S3ObjectAttributes getObjectAttributes() throws IOException { .build()); objectAttributes = new S3ObjectAttributes(); objectAttributes.length = response.contentLength(); + objectAttributes.contentType = response.contentType(); objectAttributes.lastModified = response.lastModified(); } catch (NoSuchBucketException | NoSuchKeyException e) { throw new NoSuchFileException(info.toString());