From c40237dfd0743a6f072c6001603f2130f7445c9a Mon Sep 17 00:00:00 2001 From: Andrew Gaul Date: Tue, 29 Oct 2024 21:35:09 -0700 Subject: [PATCH] Add Last-Modified to azureblob-sdk getBlob Also ETag and creation date. References #606. --- .../java/org/gaul/s3proxy/azureblob/AzureBlobStore.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/gaul/s3proxy/azureblob/AzureBlobStore.java b/src/main/java/org/gaul/s3proxy/azureblob/AzureBlobStore.java index e9e336fd..3d5fa16b 100644 --- a/src/main/java/org/gaul/s3proxy/azureblob/AzureBlobStore.java +++ b/src/main/java/org/gaul/s3proxy/azureblob/AzureBlobStore.java @@ -296,7 +296,7 @@ public Blob getBlob(String container, String key, GetOptions options) { } var properties = blobStream.getProperties(); var expires = properties.getExpiresOn(); - return new BlobBuilderImpl() + var blob = new BlobBuilderImpl() .name(key) .userMetadata(properties.getMetadata()) .payload(blobStream) @@ -308,6 +308,11 @@ public Blob getBlob(String container, String key, GetOptions options) { .contentType(properties.getContentType()) .expires(expires != null ? toDate(expires) : null) .build(); + var metadata = blob.getMetadata(); + metadata.setETag(properties.getETag()); + metadata.setCreationDate(toDate(properties.getCreationTime())); + metadata.setLastModified(toDate(properties.getLastModified())); + return blob; } @Override