mirror of https://github.com/apache/jclouds.git
Allow setting content metadata during copyBlob
Also remove unneeded call to setBlobMetadata which copy sets.
This commit is contained in:
parent
85bc4a6b7e
commit
b64d05abb9
|
@ -242,15 +242,25 @@ public class AzureBlobStore extends BaseBlobStore {
|
|||
URI source = context.getSigner().signGetBlob(fromContainer, fromName).getEndpoint();
|
||||
String eTag = sync.copyBlob(source, toContainer, toName, azureOptions.build());
|
||||
|
||||
ContentMetadataBuilder builder = ContentMetadataBuilder.create();
|
||||
|
||||
Optional<ContentMetadata> contentMetadata = options.getContentMetadata();
|
||||
if (contentMetadata.isPresent()) {
|
||||
ContentMetadataBuilder builder = ContentMetadataBuilder.create();
|
||||
|
||||
String contentDisposition = contentMetadata.get().getContentDisposition();
|
||||
if (contentDisposition != null) {
|
||||
builder.contentDisposition(contentDisposition);
|
||||
}
|
||||
|
||||
String contentEncoding = contentMetadata.get().getContentEncoding();
|
||||
if (contentEncoding != null) {
|
||||
builder.contentEncoding(contentEncoding);
|
||||
}
|
||||
|
||||
String contentLanguage = contentMetadata.get().getContentLanguage();
|
||||
if (contentLanguage != null) {
|
||||
builder.contentLanguage(contentLanguage);
|
||||
}
|
||||
|
||||
String contentType = contentMetadata.get().getContentType();
|
||||
if (contentType != null) {
|
||||
builder.contentType(contentType);
|
||||
|
@ -259,10 +269,6 @@ public class AzureBlobStore extends BaseBlobStore {
|
|||
eTag = sync.setBlobProperties(toContainer, toName, builder.build());
|
||||
}
|
||||
|
||||
if (userMetadata.isPresent()) {
|
||||
eTag = sync.setBlobMetadata(toContainer, toName, userMetadata.get());
|
||||
}
|
||||
|
||||
return eTag;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue