Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Blob generate
  • Loading branch information
gapra-msft committed Jan 15, 2021
commit c708ca0cf105043411598b20b7668511e0631e45
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
import com.azure.core.util.FluxUtil;
import com.azure.core.util.logging.ClientLogger;
import com.azure.storage.blob.BlobServiceVersion;
import com.azure.storage.blob.implementation.AzureBlobStorageBuilder;
import com.azure.storage.blob.implementation.AzureBlobStorageImpl;
import com.azure.storage.blob.models.AccessTier;
import com.azure.storage.blob.models.BlobStorageException;
import com.azure.storage.blob.models.DeleteSnapshotsOptionType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import com.azure.core.util.CoreUtils;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.logging.ClientLogger;
import com.azure.storage.blob.implementation.models.ServicesSubmitBatchResponse;
import com.azure.storage.blob.models.BlobStorageException;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.azure.storage.common.implementation.connectionstring.StorageConnectionString;
import com.azure.storage.common.implementation.connectionstring.StorageEndpoint;
import com.azure.storage.common.policy.RequestRetryOptions;

import java.io.OutputStream;
import java.net.MalformedURLException;
import java.net.URL;
Expand Down Expand Up @@ -156,8 +157,7 @@ public BlobClientBuilder customerProvidedKey(CustomerProvidedKey customerProvide
} else {
this.customerProvidedKey = new CpkInfo()
.setEncryptionKey(customerProvidedKey.getKey())
.setEncryptionKeySha256(customerProvidedKey.getKeySha256())
.setEncryptionAlgorithm(customerProvidedKey.getEncryptionAlgorithm());
.setEncryptionKeySha256(customerProvidedKey.getKeySha256());
}

return this;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
import com.azure.core.util.Context;
import com.azure.core.util.FluxUtil;
import com.azure.core.util.logging.ClientLogger;
import com.azure.storage.blob.implementation.AzureBlobStorageBuilder;
import com.azure.storage.blob.implementation.AzureBlobStorageImpl;
import com.azure.storage.blob.implementation.models.ContainerGetAccountInfoHeaders;
import com.azure.storage.blob.implementation.models.ContainerGetPropertiesHeaders;
import com.azure.storage.blob.implementation.AzureBlobStorageImplBuilder;
import com.azure.storage.blob.implementation.models.ContainersGetAccountInfoHeaders;
import com.azure.storage.blob.implementation.models.ContainersGetPropertiesHeaders;
import com.azure.storage.blob.implementation.models.ContainersListBlobFlatSegmentResponse;
import com.azure.storage.blob.implementation.models.ContainersListBlobHierarchySegmentResponse;
import com.azure.storage.blob.implementation.models.EncryptionScope;
Expand Down Expand Up @@ -123,11 +123,10 @@ public final class BlobContainerAsyncClient {
} catch (IllegalArgumentException ex) {
throw logger.logExceptionAsError(ex);
}
this.azureBlobStorage = new AzureBlobStorageBuilder()
this.azureBlobStorage = new AzureBlobStorageImplBuilder()
.pipeline(pipeline)
.url(url)
.version(serviceVersion.getVersion())
.build();
.buildClient();
this.serviceVersion = serviceVersion;

this.accountName = accountName;
Expand Down Expand Up @@ -374,8 +373,9 @@ public Mono<Response<Void>> createWithResponse(Map<String, String> metadata, Pub
Mono<Response<Void>> createWithResponse(Map<String, String> metadata, PublicAccessType accessType,
Context context) {
context = context == null ? Context.NONE : context;
return this.azureBlobStorage.containers().createWithRestResponseAsync(
null, null, metadata, accessType, null, blobContainerEncryptionScope,
// TODO Fix metadata
return this.azureBlobStorage.getContainers().createWithResponseAsync(
null, null, /*metadata*/null, accessType, null, blobContainerEncryptionScope,
context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE))
.map(response -> new SimpleResponse<>(response, null));
}
Expand Down Expand Up @@ -432,7 +432,7 @@ Mono<Response<Void>> deleteWithResponse(BlobRequestConditions requestConditions,
}
context = context == null ? Context.NONE : context;

return this.azureBlobStorage.containers().deleteWithRestResponseAsync(null, null,
return this.azureBlobStorage.getContainers().deleteWithResponseAsync(null, null,
requestConditions.getLeaseId(), requestConditions.getIfModifiedSince(),
requestConditions.getIfUnmodifiedSince(), null,
context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE))
Expand Down Expand Up @@ -480,16 +480,17 @@ public Mono<Response<BlobContainerProperties>> getPropertiesWithResponse(String
Mono<Response<BlobContainerProperties>> getPropertiesWithResponse(String leaseId, Context context) {
context = context == null ? Context.NONE : context;

return this.azureBlobStorage.containers()
.getPropertiesWithRestResponseAsync(null, null, leaseId, null,
return this.azureBlobStorage.getContainers()
.getPropertiesWithResponseAsync(null, null, leaseId, null,
context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE))
.map(rb -> {
ContainerGetPropertiesHeaders hd = rb.getDeserializedHeaders();
BlobContainerProperties properties = new BlobContainerProperties(hd.getMetadata(), hd.getETag(),
hd.getLastModified(), hd.getLeaseDuration(), hd.getLeaseState(), hd.getLeaseStatus(),
hd.getBlobPublicAccess(), Boolean.TRUE.equals(hd.isHasImmutabilityPolicy()),
Boolean.TRUE.equals(hd.isHasLegalHold()), hd.getDefaultEncryptionScope(),
hd.isDenyEncryptionScopeOverride());
ContainersGetPropertiesHeaders hd = rb.getDeserializedHeaders();
// TODo Fix metadata
BlobContainerProperties properties = new BlobContainerProperties(/*hd.getXMsMeta()*/null, hd.getETag(),
hd.getLastModified(), hd.getXMsLeaseDuration(), hd.getXMsLeaseState(), hd.getXMsLeaseStatus(),
hd.getXMsBlobPublicAccess(), Boolean.TRUE.equals(hd.isXMsHasImmutabilityPolicy()),
Boolean.TRUE.equals(hd.isXMsHasLegalHold()), hd.getXMsDefaultEncryptionScope(),
hd.isXMsDenyEncryptionScopeOverride());
return new SimpleResponse<>(rb, properties);
});
}
Expand Down Expand Up @@ -551,8 +552,9 @@ Mono<Response<Void>> setMetadataWithResponse(Map<String, String> metadata,
"If-Modified-Since is the only HTTP access condition supported for this API"));
}

return this.azureBlobStorage.containers().setMetadataWithRestResponseAsync(null, null,
requestConditions.getLeaseId(), metadata, requestConditions.getIfModifiedSince(), null,
// todo metadata
return this.azureBlobStorage.getContainers().setMetadataWithResponseAsync(null, null,
requestConditions.getLeaseId(), /*metadata*/null, requestConditions.getIfModifiedSince(), null,
context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE))
.map(response -> new SimpleResponse<>(response, null));
}
Expand Down Expand Up @@ -598,11 +600,11 @@ public Mono<Response<BlobContainerAccessPolicies>> getAccessPolicyWithResponse(S

Mono<Response<BlobContainerAccessPolicies>> getAccessPolicyWithResponse(String leaseId, Context context) {
context = context == null ? Context.NONE : context;
return this.azureBlobStorage.containers().getAccessPolicyWithRestResponseAsync(
return this.azureBlobStorage.getContainers().getAccessPolicyWithResponseAsync(
null, null, leaseId, null,
context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE))
.map(response -> new SimpleResponse<>(response,
new BlobContainerAccessPolicies(response.getDeserializedHeaders().getBlobPublicAccess(),
new BlobContainerAccessPolicies(response.getDeserializedHeaders().getXMsBlobPublicAccess(),
response.getValue())));
}

Expand Down Expand Up @@ -695,9 +697,9 @@ OffsetDateTime.now will only give back milliseconds (more precise fields are zer
}
context = context == null ? Context.NONE : context;

return this.azureBlobStorage.containers().setAccessPolicyWithRestResponseAsync(
null, identifiers, null, requestConditions.getLeaseId(), accessType, requestConditions.getIfModifiedSince(),
requestConditions.getIfUnmodifiedSince(), null,
return this.azureBlobStorage.getContainers().setAccessPolicyWithResponseAsync(
null, null, requestConditions.getLeaseId(), accessType, requestConditions.getIfModifiedSince(),
requestConditions.getIfUnmodifiedSince(), null, identifiers,
context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE))
.map(response -> new SimpleResponse<>(response, null));
}
Expand Down Expand Up @@ -857,7 +859,7 @@ private Mono<ContainersListBlobFlatSegmentResponse> listBlobsFlatSegment(String
options.getDetails().toList().isEmpty() ? null : options.getDetails().toList();

return StorageImplUtils.applyOptionalTimeout(
this.azureBlobStorage.containers().listBlobFlatSegmentWithRestResponseAsync(null, options.getPrefix(),
this.azureBlobStorage.getContainers().listBlobFlatSegmentWithResponseAsync(null, options.getPrefix(),
marker, options.getMaxResultsPerPage(), include,
null, null, Context.NONE), timeout);
}
Expand Down Expand Up @@ -988,7 +990,7 @@ private Mono<ContainersListBlobHierarchySegmentResponse> listBlobsHierarchySegme
options.getDetails().toList().isEmpty() ? null : options.getDetails().toList();

return StorageImplUtils.applyOptionalTimeout(
this.azureBlobStorage.containers().listBlobHierarchySegmentWithRestResponseAsync(null, delimiter,
this.azureBlobStorage.getContainers().listBlobHierarchySegmentWithResponseAsync(null, delimiter,
options.getPrefix(), marker, options.getMaxResultsPerPage(), include, null, null,
Context.NONE),
timeout);
Expand Down Expand Up @@ -1032,11 +1034,11 @@ public Mono<Response<StorageAccountInfo>> getAccountInfoWithResponse() {

Mono<Response<StorageAccountInfo>> getAccountInfoWithResponse(Context context) {
context = context == null ? Context.NONE : context;
return this.azureBlobStorage.containers().getAccountInfoWithRestResponseAsync(null,
return this.azureBlobStorage.getContainers().getAccountInfoWithResponseAsync(null,
context.addData(AZ_TRACING_NAMESPACE_KEY, STORAGE_TRACING_NAMESPACE_VALUE))
.map(rb -> {
ContainerGetAccountInfoHeaders hd = rb.getDeserializedHeaders();
return new SimpleResponse<>(rb, new StorageAccountInfo(hd.getSkuName(), hd.getAccountKind()));
ContainersGetAccountInfoHeaders hd = rb.getDeserializedHeaders();
return new SimpleResponse<>(rb, new StorageAccountInfo(hd.getXMsSkuName(), hd.getXMsAccountKind()));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.azure.storage.common.implementation.connectionstring.StorageConnectionString;
import com.azure.storage.common.implementation.connectionstring.StorageEndpoint;
import com.azure.storage.common.policy.RequestRetryOptions;

import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
Expand Down Expand Up @@ -174,8 +175,7 @@ public BlobContainerClientBuilder customerProvidedKey(CustomerProvidedKey custom
} else {
this.customerProvidedKey = new CpkInfo()
.setEncryptionKey(customerProvidedKey.getKey())
.setEncryptionKeySha256(customerProvidedKey.getKeySha256())
.setEncryptionAlgorithm(customerProvidedKey.getEncryptionAlgorithm());
.setEncryptionKeySha256(customerProvidedKey.getKeySha256());
}

return this;
Expand Down
Loading