Skip to content

Commit 0baf44e

Browse files
committed
Get and set content disposition and encoding
This allows more jclouds integration tests to pass. References #34.
1 parent 893f491 commit 0baf44e

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/main/java/com/bouncestorage/swiftproxy/v1/ObjectResource.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -711,6 +711,12 @@ public Response putObject(@NotNull @PathParam("container") String container,
711711
BlobBuilder.PayloadBlobBuilder builder = blobStore.blobBuilder(objectName)
712712
.userMetadata(metadata)
713713
.payload(is);
714+
if (contentDisposition != null) {
715+
builder.contentDisposition(contentDisposition);
716+
}
717+
if (contentEncoding != null) {
718+
builder.contentEncoding(contentEncoding);
719+
}
714720
if (contentType != null) {
715721
builder.contentType(contentType(contentType.toString()));
716722
}
@@ -822,6 +828,8 @@ private Response.ResponseBuilder addObjectHeaders(Response.ResponseBuilder respo
822828
}
823829

824830
Map<String, Supplier<Object>> defaultHeaders = ImmutableMap.<String, Supplier<Object>>builder()
831+
.put(HttpHeaders.CONTENT_DISPOSITION, () -> metaData.getContentMetadata().getContentDisposition())
832+
.put(HttpHeaders.CONTENT_ENCODING, () -> metaData.getContentMetadata().getContentEncoding())
825833
.put(HttpHeaders.CONTENT_LENGTH, metaData::getSize)
826834
.put(HttpHeaders.LAST_MODIFIED, metaData::getLastModified)
827835
.put(HttpHeaders.ETAG, metaData::getETag)

0 commit comments

Comments
 (0)