Skip to content

Commit

Permalink
Add Last-Modified to azureblob-sdk getBlob
Browse files Browse the repository at this point in the history
Also ETag and creation date.  References #606.
  • Loading branch information
gaul committed Oct 30, 2024
1 parent c2106fa commit c40237d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/main/java/org/gaul/s3proxy/azureblob/AzureBlobStore.java
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit c40237d

Please sign in to comment.