diff --git a/eng/versioning/version_client.txt b/eng/versioning/version_client.txt
index 51a3f58368015..a6a6013c67bfd 100644
--- a/eng/versioning/version_client.txt
+++ b/eng/versioning/version_client.txt
@@ -490,6 +490,9 @@ unreleased_com.azure:azure-json;1.3.0-beta.1
unreleased_com.azure:azure-core-amqp;2.10.0-beta.1
+unreleased_com.azure:azure-core;1.52.0-beta.1
+unreleased_com.azure:azure-core-http-okhttp;1.13.0-beta.1
+
# Released Beta dependencies: Copy the entry from above, prepend "beta_", remove the current
# version and set the version to the released beta. Released beta dependencies are only valid
# for dependency versions. These entries are specifically for when we've released a beta for
diff --git a/sdk/storage/azure-storage-blob/checkstyle-suppressions.xml b/sdk/storage/azure-storage-blob/checkstyle-suppressions.xml
index f106f985d40b3..d2e954d56ed63 100644
--- a/sdk/storage/azure-storage-blob/checkstyle-suppressions.xml
+++ b/sdk/storage/azure-storage-blob/checkstyle-suppressions.xml
@@ -35,7 +35,14 @@
+
+
+
+
+
+
+
diff --git a/sdk/storage/azure-storage-blob/pom.xml b/sdk/storage/azure-storage-blob/pom.xml
index 1e89f040f855a..de8794e58472c 100644
--- a/sdk/storage/azure-storage-blob/pom.xml
+++ b/sdk/storage/azure-storage-blob/pom.xml
@@ -70,7 +70,7 @@
com.azure
azure-core
- 1.51.0
+ 1.52.0-beta.1
com.azure
@@ -182,7 +182,7 @@
com.azure
azure-core-http-okhttp
- 1.12.2
+ 1.13.0-beta.1
test
diff --git a/sdk/storage/azure-storage-blob/spotbugs-exclude.xml b/sdk/storage/azure-storage-blob/spotbugs-exclude.xml
index 1d9d591bb4dd3..8b12ac100b680 100644
--- a/sdk/storage/azure-storage-blob/spotbugs-exclude.xml
+++ b/sdk/storage/azure-storage-blob/spotbugs-exclude.xml
@@ -8,6 +8,7 @@
+
@@ -185,4 +186,8 @@
+
+
+
+
diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClient.java
index 360104fb2f524..2951e455c2256 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClient.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClient.java
@@ -6,13 +6,16 @@
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.http.HttpPipeline;
import com.azure.core.http.rest.Response;
import com.azure.core.util.BinaryData;
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.models.EncryptionScope;
import com.azure.storage.blob.implementation.util.ModelHelper;
import com.azure.storage.blob.models.AccessTier;
+import com.azure.storage.blob.models.CpkInfo;
import com.azure.storage.blob.models.CustomerProvidedKey;
import com.azure.storage.blob.options.BlobParallelUploadOptions;
import com.azure.storage.blob.models.BlobRequestConditions;
@@ -32,6 +35,8 @@
import java.io.InputStream;
import java.io.UncheckedIOException;
+import java.nio.channels.AsynchronousFileChannel;
+import java.nio.file.Path;
import java.time.Duration;
import java.util.Map;
import java.util.Objects;
@@ -61,19 +66,26 @@ public class BlobClient extends BlobClientBase {
/**
* The block size to use if none is specified in parallel operations.
*/
- public static final int BLOB_DEFAULT_UPLOAD_BLOCK_SIZE = BlobAsyncClient.BLOB_DEFAULT_UPLOAD_BLOCK_SIZE;
+ public static final int BLOB_DEFAULT_UPLOAD_BLOCK_SIZE = 4 * Constants.MB;
/**
* The number of buffers to use if none is specied on the buffered upload method.
*/
- public static final int BLOB_DEFAULT_NUMBER_OF_BUFFERS = BlobAsyncClient.BLOB_DEFAULT_NUMBER_OF_BUFFERS;
+ public static final int BLOB_DEFAULT_NUMBER_OF_BUFFERS = 8;
/**
* If a blob is known to be greater than 100MB, using a larger block size will trigger some server-side
* optimizations. If the block size is not set and the size of the blob is known to be greater than 100MB, this
* value will be used.
*/
- public static final int BLOB_DEFAULT_HTBB_UPLOAD_BLOCK_SIZE = BlobAsyncClient.BLOB_DEFAULT_HTBB_UPLOAD_BLOCK_SIZE;
+ public static final int BLOB_DEFAULT_HTBB_UPLOAD_BLOCK_SIZE = 8 * Constants.MB;
+ /**
+ * The default block size used in {@link FluxUtil#readFile(AsynchronousFileChannel)}.
+ * This is to make sure we're using same size when using {@link BinaryData#fromFile(Path, int)}
+ * and {@link BinaryData#fromFile(Path, Long, Long, int)}
+ * to represent the content.
+ */
+ private static final int DEFAULT_FILE_READ_CHUNK_SIZE = 1024 * 64;
private final BlobAsyncClient client;
private BlockBlobClient blockBlobClient;
@@ -89,6 +101,31 @@ protected BlobClient(BlobAsyncClient client) {
this.client = client;
}
+ /**
+ * Protected constructor for use by {@link BlobClientBuilder}.
+ *
+ * @param client the async blob client
+ * @param pipeline The pipeline used to send and receive service requests.
+ * @param url The endpoint where to send service requests.
+ * @param serviceVersion The version of the service to receive requests.
+ * @param accountName The storage account name.
+ * @param containerName The container name.
+ * @param blobName The blob name.
+ * @param snapshot The snapshot identifier for the blob, pass {@code null} to interact with the blob directly.
+ * @param customerProvidedKey Customer provided key used during encryption of the blob's data on the server, pass
+ * {@code null} to allow the service to use its own encryption.
+ * @param encryptionScope Encryption scope used during encryption of the blob's data on the server, pass
+ * {@code null} to allow the service to use its own encryption.
+ * @param versionId The version identifier for the blob, pass {@code null} to interact with the latest blob version.
+ */
+ protected BlobClient(BlobAsyncClient client, HttpPipeline pipeline, String url, BlobServiceVersion serviceVersion,
+ String accountName, String containerName, String blobName, String snapshot, CpkInfo customerProvidedKey,
+ EncryptionScope encryptionScope, String versionId) {
+ super(client, pipeline, url, serviceVersion, accountName, containerName, blobName, snapshot, customerProvidedKey,
+ encryptionScope, versionId);
+ this.client = client;
+ }
+
/**
* Creates a new {@link BlobClient} linked to the {@code snapshot} of this blob resource.
*
@@ -97,7 +134,11 @@ protected BlobClient(BlobAsyncClient client) {
*/
@Override
public BlobClient getSnapshotClient(String snapshot) {
- return new BlobClient(client.getSnapshotClient(snapshot));
+ BlobAsyncClient asyncClient = new BlobAsyncClient(getHttpPipeline(), getAccountUrl(), getServiceVersion(),
+ getAccountName(), getContainerName(), getBlobName(), snapshot, getCustomerProvidedKey(),
+ encryptionScope, getVersionId());
+ return new BlobClient(asyncClient, getHttpPipeline(), getAccountUrl(), getServiceVersion(), getAccountName(),
+ getContainerName(), getBlobName(), snapshot, getCustomerProvidedKey(), encryptionScope, getVersionId());
}
/**
@@ -109,7 +150,11 @@ public BlobClient getSnapshotClient(String snapshot) {
*/
@Override
public BlobClient getVersionClient(String versionId) {
- return new BlobClient(client.getVersionClient(versionId));
+ BlobAsyncClient asyncClient = new BlobAsyncClient(getHttpPipeline(), getAccountUrl(), getServiceVersion(),
+ getAccountName(), getContainerName(), getBlobName(), getSnapshotId(), getCustomerProvidedKey(),
+ encryptionScope, versionId);
+ return new BlobClient(asyncClient, getHttpPipeline(), getAccountUrl(), getServiceVersion(), getAccountName(),
+ getContainerName(), getBlobName(), getSnapshotId(), getCustomerProvidedKey(), encryptionScope, versionId);
}
/**
@@ -120,7 +165,13 @@ public BlobClient getVersionClient(String versionId) {
*/
@Override
public BlobClient getEncryptionScopeClient(String encryptionScope) {
- return new BlobClient(client.getEncryptionScopeAsyncClient(encryptionScope));
+ EncryptionScope finalEncryptionScope = null;
+ if (encryptionScope != null) {
+ finalEncryptionScope = new EncryptionScope().setEncryptionScope(encryptionScope);
+ }
+ return new BlobClient(this.client.getEncryptionScopeAsyncClient(encryptionScope), getHttpPipeline(),
+ getAccountUrl(), getServiceVersion(), getAccountName(), getContainerName(), getBlobName(), getSnapshotId(),
+ getCustomerProvidedKey(), finalEncryptionScope, getVersionId());
}
/**
@@ -132,7 +183,16 @@ public BlobClient getEncryptionScopeClient(String encryptionScope) {
*/
@Override
public BlobClient getCustomerProvidedKeyClient(CustomerProvidedKey customerProvidedKey) {
- return new BlobClient(client.getCustomerProvidedKeyAsyncClient(customerProvidedKey));
+ CpkInfo finalCustomerProvidedKey = null;
+ if (customerProvidedKey != null) {
+ finalCustomerProvidedKey = new CpkInfo()
+ .setEncryptionKey(customerProvidedKey.getKey())
+ .setEncryptionKeySha256(customerProvidedKey.getKeySha256())
+ .setEncryptionAlgorithm(customerProvidedKey.getEncryptionAlgorithm());
+ }
+ return new BlobClient(this.client.getCustomerProvidedKeyAsyncClient(customerProvidedKey), getHttpPipeline(),
+ getAccountUrl(), getServiceVersion(), getAccountName(), getContainerName(), getBlobName(), getSnapshotId(),
+ finalCustomerProvidedKey, encryptionScope, getVersionId());
}
/**
diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClientBuilder.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClientBuilder.java
index 9f68b931df66c..c980ef37a0715 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClientBuilder.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobClientBuilder.java
@@ -127,7 +127,29 @@ public BlobClientBuilder() {
* and {@link #retryOptions(RequestRetryOptions)} have been set.
*/
public BlobClient buildClient() {
- return new BlobClient(buildAsyncClient());
+ Objects.requireNonNull(blobName, "'blobName' cannot be null.");
+ Objects.requireNonNull(endpoint, "'endpoint' cannot be null");
+
+ BuilderHelper.httpsValidation(customerProvidedKey, "customer provided key", endpoint, LOGGER);
+
+ if (Objects.nonNull(customerProvidedKey) && Objects.nonNull(encryptionScope)) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException("Customer provided key and encryption "
+ + "scope cannot both be set"));
+ }
+
+ /*
+ Implicit and explicit root container access are functionally equivalent, but explicit references are easier
+ to read and debug.
+ */
+ String blobContainerName = CoreUtils.isNullOrEmpty(containerName) ? BlobContainerClient.ROOT_CONTAINER_NAME
+ : containerName;
+
+ BlobServiceVersion serviceVersion = version != null ? version : BlobServiceVersion.getLatest();
+
+ BlobAsyncClient asyncClient = buildAsyncClient();
+
+ return new BlobClient(asyncClient, asyncClient.getHttpPipeline(), endpoint, serviceVersion, accountName,
+ blobContainerName, blobName, snapshot, customerProvidedKey, encryptionScope, versionId);
}
/**
@@ -171,15 +193,19 @@ public BlobAsyncClient buildAsyncClient() {
BlobServiceVersion serviceVersion = version != null ? version : BlobServiceVersion.getLatest();
- HttpPipeline pipeline = (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline(
- storageSharedKeyCredential, tokenCredential, azureSasCredential, sasToken,
- endpoint, retryOptions, coreRetryOptions, logOptions,
- clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, audience, LOGGER);
+ HttpPipeline pipeline = constructPipeline();
return new BlobAsyncClient(pipeline, endpoint, serviceVersion, accountName, blobContainerName, blobName,
snapshot, customerProvidedKey, encryptionScope, versionId);
}
+ private HttpPipeline constructPipeline() {
+ return (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline(
+ storageSharedKeyCredential, tokenCredential, azureSasCredential, sasToken,
+ endpoint, retryOptions, coreRetryOptions, logOptions,
+ clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, audience, LOGGER);
+ }
+
/**
* Sets the {@link CustomerProvidedKey customer provided key} that is used to encrypt blob contents on the server.
*
diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java
index 753176857abc4..adb06e7e29214 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerAsyncClient.java
@@ -56,7 +56,6 @@
import java.net.URI;
import java.time.Duration;
import java.time.OffsetDateTime;
-import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@@ -315,6 +314,19 @@ public String getEncryptionScope() {
return encryptionScope.getEncryptionScope();
}
+ /**
+ * Gets the {@link EncryptionScope} used to encrypt this blob's content on the server.
+ *
+ * @return the encryption scope used for encryption.
+ */
+ BlobContainerEncryptionScope getBlobContainerEncryptionScope() {
+ if (blobContainerEncryptionScope == null) {
+ return null;
+ }
+ return blobContainerEncryptionScope;
+ }
+
+
/**
* Gets if the container this client represents exists in the cloud.
*
@@ -565,7 +577,7 @@ public Mono> deleteWithResponse(BlobRequestConditions requestCond
Mono> deleteWithResponse(BlobRequestConditions requestConditions, Context context) {
requestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions;
- if (!validateNoETag(requestConditions)) {
+ if (!ModelHelper.validateNoETag(requestConditions)) {
// Throwing is preferred to Mono.error because this will error out immediately instead of waiting until
// subscription.
throw LOGGER.logExceptionAsError(
@@ -791,7 +803,7 @@ Mono> setMetadataWithResponse(Map metadata,
BlobRequestConditions requestConditions, Context context) {
context = context == null ? Context.NONE : context;
requestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions;
- if (!validateNoETag(requestConditions) || requestConditions.getIfUnmodifiedSince() != null) {
+ if (!ModelHelper.validateNoETag(requestConditions) || requestConditions.getIfUnmodifiedSince() != null) {
// Throwing is preferred to Mono.error because this will error out immediately instead of waiting until
// subscription.
throw LOGGER.logExceptionAsError(new UnsupportedOperationException(
@@ -961,36 +973,19 @@ Mono> setAccessPolicyWithResponse(PublicAccessType accessType,
List identifiers, BlobRequestConditions requestConditions, Context context) {
requestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions;
- if (!validateNoETag(requestConditions)) {
+ if (!ModelHelper.validateNoETag(requestConditions)) {
// Throwing is preferred to Mono.error because this will error out immediately instead of waiting until
// subscription.
throw LOGGER.logExceptionAsError(
new UnsupportedOperationException("ETag access conditions are not supported for this API."));
}
- /*
- We truncate to seconds because the service only supports nanoseconds or seconds, but doing an
- OffsetDateTime.now will only give back milliseconds (more precise fields are zeroed and not serialized). This
- allows for proper serialization with no real detriment to users as sub-second precision on active time for
- signed identifiers is not really necessary.
- */
- if (identifiers != null) {
- for (BlobSignedIdentifier identifier : identifiers) {
- if (identifier.getAccessPolicy() != null && identifier.getAccessPolicy().getStartsOn() != null) {
- identifier.getAccessPolicy().setStartsOn(
- identifier.getAccessPolicy().getStartsOn().truncatedTo(ChronoUnit.SECONDS));
- }
- if (identifier.getAccessPolicy() != null && identifier.getAccessPolicy().getExpiresOn() != null) {
- identifier.getAccessPolicy().setExpiresOn(
- identifier.getAccessPolicy().getExpiresOn().truncatedTo(ChronoUnit.SECONDS));
- }
- }
- }
+ List finalIdentifiers = ModelHelper.truncateTimeForBlobSignedIdentifier(identifiers);
context = context == null ? Context.NONE : context;
return this.azureBlobStorage.getContainers().setAccessPolicyNoCustomHeadersWithResponseAsync(containerName,
null, requestConditions.getLeaseId(), accessType, requestConditions.getIfModifiedSince(),
- requestConditions.getIfUnmodifiedSince(), null, identifiers, context);
+ requestConditions.getIfUnmodifiedSince(), null, finalIdentifiers, context);
}
/**
@@ -1725,13 +1720,6 @@ public String generateSas(BlobServiceSasSignatureValues blobServiceSasSignatureV
.generateSas(SasImplUtils.extractSharedKeyCredential(getHttpPipeline()), stringToSignHandler, context);
}
- private static boolean validateNoETag(BlobRequestConditions modifiedRequestConditions) {
- if (modifiedRequestConditions == null) {
- return true;
- }
- return modifiedRequestConditions.getIfMatch() == null && modifiedRequestConditions.getIfNoneMatch() == null;
- }
-
// private boolean validateNoTime(BlobRequestConditions modifiedRequestConditions) {
// if (modifiedRequestConditions == null) {
// return true;
diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java
index cc5528333cb56..aac26a1fd1eaa 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClient.java
@@ -6,16 +6,47 @@
import com.azure.core.annotation.ReturnType;
import com.azure.core.annotation.ServiceClient;
import com.azure.core.annotation.ServiceMethod;
+import com.azure.core.exception.HttpResponseException;
import com.azure.core.http.HttpPipeline;
+import com.azure.core.http.HttpResponse;
import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.ResponseBase;
+import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.SharedExecutorService;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.storage.blob.implementation.AzureBlobStorageImpl;
+import com.azure.storage.blob.implementation.AzureBlobStorageImplBuilder;
+import com.azure.storage.blob.implementation.accesshelpers.BlobItemConstructorProxy;
+import com.azure.storage.blob.implementation.models.BlobHierarchyListSegment;
+import com.azure.storage.blob.implementation.models.BlobSignedIdentifierWrapper;
+import com.azure.storage.blob.implementation.models.ContainersFilterBlobsHeaders;
+import com.azure.storage.blob.implementation.models.ContainersGetAccessPolicyHeaders;
+import com.azure.storage.blob.implementation.models.ContainersGetAccountInfoHeaders;
+import com.azure.storage.blob.implementation.models.ContainersGetPropertiesHeaders;
+import com.azure.storage.blob.implementation.models.ContainersListBlobFlatSegmentHeaders;
+import com.azure.storage.blob.implementation.models.ContainersListBlobHierarchySegmentHeaders;
+import com.azure.storage.blob.implementation.models.EncryptionScope;
+import com.azure.storage.blob.implementation.models.FilterBlobSegment;
+import com.azure.storage.blob.implementation.models.ListBlobsFlatSegmentResponse;
+import com.azure.storage.blob.implementation.models.ListBlobsHierarchySegmentResponse;
+import com.azure.storage.blob.implementation.util.BlobSasImplUtil;
+import com.azure.storage.blob.implementation.util.ModelHelper;
import com.azure.storage.blob.models.BlobContainerAccessPolicies;
+import com.azure.storage.blob.models.BlobContainerEncryptionScope;
import com.azure.storage.blob.models.BlobContainerProperties;
+import com.azure.storage.blob.models.BlobErrorCode;
import com.azure.storage.blob.models.BlobItem;
import com.azure.storage.blob.models.BlobRequestConditions;
import com.azure.storage.blob.models.BlobSignedIdentifier;
+import com.azure.storage.blob.models.BlobStorageException;
import com.azure.storage.blob.models.CpkInfo;
+import com.azure.storage.blob.models.CustomerProvidedKey;
+import com.azure.storage.blob.models.ListBlobsIncludeItem;
import com.azure.storage.blob.models.ListBlobsOptions;
import com.azure.storage.blob.models.PublicAccessType;
import com.azure.storage.blob.models.StorageAccountInfo;
@@ -25,16 +56,27 @@
import com.azure.storage.blob.options.FindBlobsOptions;
import com.azure.storage.blob.sas.BlobServiceSasSignatureValues;
import com.azure.storage.common.StorageSharedKeyCredential;
+import com.azure.storage.common.implementation.SasImplUtils;
import com.azure.storage.common.implementation.StorageImplUtils;
-import reactor.core.publisher.Mono;
+import java.net.URI;
import java.time.Duration;
import java.time.OffsetDateTime;
+import java.util.ArrayList;
+import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.Callable;
+import java.util.concurrent.ExecutionException;
+import java.util.concurrent.TimeoutException;
+import java.util.function.BiFunction;
+import java.util.function.Supplier;
+import java.util.stream.Collectors;
import java.util.function.Consumer;
-import static com.azure.storage.common.implementation.StorageImplUtils.blockWithOptionalTimeout;
+import static com.azure.storage.blob.implementation.util.ModelHelper.wrapServiceCallWithExceptionMapping;
+import static com.azure.storage.blob.implementation.util.ModelHelper.wrapTimeoutServiceCallWithExceptionMapping;
+import static com.azure.storage.common.implementation.StorageImplUtils.sendRequest;
/**
* Client to a container. It may only be instantiated through a {@link BlobContainerClientBuilder} or via the method
@@ -52,8 +94,6 @@
*/
@ServiceClient(builder = BlobContainerClientBuilder.class)
public final class BlobContainerClient {
- private final BlobContainerAsyncClient client;
-
/**
* Special container name for the root container in the Storage account.
*/
@@ -68,6 +108,15 @@ public final class BlobContainerClient {
* Special container name for the logs container in the Storage account.
*/
public static final String LOG_CONTAINER_NAME = BlobContainerAsyncClient.LOG_CONTAINER_NAME;
+ private static final ClientLogger LOGGER = new ClientLogger(BlobContainerClient.class);
+ private final AzureBlobStorageImpl azureBlobStorage;
+
+ private final String accountName;
+ private final String containerName;
+ private final BlobServiceVersion serviceVersion;
+ private final CpkInfo customerProvidedKey; // only used to pass down to blob clients
+ private final EncryptionScope encryptionScope; // only used to pass down to blob clients
+ private final BlobContainerEncryptionScope blobContainerEncryptionScope;
/**
* Package-private constructor for use by {@link BlobContainerClientBuilder}.
@@ -75,7 +124,47 @@ public final class BlobContainerClient {
* @param client the async container client
*/
BlobContainerClient(BlobContainerAsyncClient client) {
- this.client = client;
+ this(client.getHttpPipeline(), client.getAccountUrl(), client.getServiceVersion(),
+ client.getAccountName(), client.getBlobContainerName(), client.getCustomerProvidedKey(),
+ new EncryptionScope().setEncryptionScope(client.getEncryptionScope()),
+ client.getBlobContainerEncryptionScope());
+ }
+
+ /**
+ * Package-private constructor for use by {@link BlobContainerClientBuilder}.
+ *
+ * @param pipeline The pipeline used to send and receive service requests.
+ * @param url The endpoint where to send service requests.
+ * @param serviceVersion The version of the service to receive requests.
+ * @param accountName The storage account name.
+ * @param containerName The container name.
+ * @param customerProvidedKey Customer provided key used during encryption of the blob's data on the server, pass
+ * {@code null} to allow the service to use its own encryption.
+ * @param encryptionScope Encryption scope used during encryption of the blob's data on the server, pass
+ * {@code null} to allow the service to use its own encryption.
+ */
+ BlobContainerClient(HttpPipeline pipeline, String url, BlobServiceVersion serviceVersion, String accountName,
+ String containerName, CpkInfo customerProvidedKey, EncryptionScope encryptionScope,
+ BlobContainerEncryptionScope blobContainerEncryptionScope) {
+ this.azureBlobStorage = new AzureBlobStorageImplBuilder()
+ .pipeline(pipeline)
+ .url(url)
+ .version(serviceVersion.getVersion())
+ .buildClient();
+ this.serviceVersion = serviceVersion;
+
+ this.accountName = accountName;
+ this.containerName = containerName;
+ this.customerProvidedKey = customerProvidedKey;
+ this.encryptionScope = encryptionScope;
+ this.blobContainerEncryptionScope = blobContainerEncryptionScope;
+ /* Check to make sure the uri is valid. We don't want the error to occur later in the generated layer
+ when the sas token has already been applied. */
+ try {
+ URI.create(getBlobContainerUrl());
+ } catch (IllegalArgumentException ex) {
+ throw LOGGER.logExceptionAsError(ex);
+ }
}
@@ -96,7 +185,7 @@ public final class BlobContainerClient {
* @return A new {@link BlobClient} object which references the blob with the specified name in this container.
*/
public BlobClient getBlobClient(String blobName) {
- return new BlobClient(client.getBlobAsyncClient(blobName));
+ return getBlobClient(blobName, null);
}
/**
@@ -117,7 +206,8 @@ public BlobClient getBlobClient(String blobName) {
* @return A new {@link BlobClient} object which references the blob with the specified name in this container.
*/
public BlobClient getBlobClient(String blobName, String snapshot) {
- return new BlobClient(client.getBlobAsyncClient(blobName, snapshot));
+ return new BlobClient(new BlobAsyncClient(getHttpPipeline(), getAccountUrl(), getServiceVersion(),
+ getAccountName(), getBlobContainerName(), blobName, snapshot, getCustomerProvidedKey(), encryptionScope));
}
/**
@@ -130,7 +220,9 @@ public BlobClient getBlobClient(String blobName, String snapshot) {
* @return A new {@link BlobClient} object which references the blob with the specified name in this container.
*/
public BlobClient getBlobVersionClient(String blobName, String versionId) {
- return new BlobClient(client.getBlobVersionAsyncClient(blobName, versionId));
+ return new BlobClient(new BlobAsyncClient(getHttpPipeline(), getAccountUrl(), getServiceVersion(),
+ getAccountName(), getBlobContainerName(), blobName, null, getCustomerProvidedKey(), encryptionScope,
+ versionId));
}
/**
@@ -148,7 +240,7 @@ public BlobClient getBlobVersionClient(String blobName, String versionId) {
* @return The name of container.
*/
public String getBlobContainerName() {
- return this.client.getBlobContainerName();
+ return containerName;
}
/**
@@ -157,7 +249,7 @@ public String getBlobContainerName() {
* @return the URL of the storage account
*/
public String getAccountUrl() {
- return this.client.getAccountUrl();
+ return azureBlobStorage.getUrl();
}
/**
@@ -166,7 +258,7 @@ public String getAccountUrl() {
* @return the URL.
*/
public String getBlobContainerUrl() {
- return client.getBlobContainerUrl();
+ return azureBlobStorage.getUrl() + "/" + containerName;
}
/**
@@ -175,7 +267,7 @@ public String getBlobContainerUrl() {
* @return account name associated with this storage resource.
*/
public String getAccountName() {
- return this.client.getAccountName();
+ return this.accountName;
}
/**
@@ -184,7 +276,15 @@ public String getAccountName() {
* @return {@link BlobServiceClient}
*/
public BlobServiceClient getServiceClient() {
- return this.client.getServiceClientBuilder().buildClient();
+ CustomerProvidedKey encryptionKey = this.customerProvidedKey == null ? null
+ : new CustomerProvidedKey(this.customerProvidedKey.getEncryptionKey());
+ return new BlobServiceClientBuilder()
+ .endpoint(this.getBlobContainerUrl())
+ .pipeline(this.getHttpPipeline())
+ .serviceVersion(this.serviceVersion)
+ .blobContainerEncryptionScope(this.blobContainerEncryptionScope)
+ .encryptionScope(this.getEncryptionScope())
+ .customerProvidedKey(encryptionKey).buildClient();
}
/**
@@ -193,7 +293,7 @@ public BlobServiceClient getServiceClient() {
* @return the service version the client is using.
*/
public BlobServiceVersion getServiceVersion() {
- return this.client.getServiceVersion();
+ return serviceVersion;
}
/**
@@ -202,7 +302,7 @@ public BlobServiceVersion getServiceVersion() {
* @return The pipeline.
*/
public HttpPipeline getHttpPipeline() {
- return client.getHttpPipeline();
+ return azureBlobStorage.getHttpPipeline();
}
/**
@@ -212,7 +312,7 @@ public HttpPipeline getHttpPipeline() {
* @return the customer provided key used for encryption.
*/
public CpkInfo getCustomerProvidedKey() {
- return client.getCustomerProvidedKey();
+ return customerProvidedKey;
}
/**
@@ -221,7 +321,10 @@ public CpkInfo getCustomerProvidedKey() {
* @return the encryption scope used for encryption.
*/
public String getEncryptionScope() {
- return client.getEncryptionScope();
+ if (encryptionScope == null) {
+ return null;
+ }
+ return encryptionScope.getEncryptionScope();
}
/**
@@ -259,9 +362,18 @@ public boolean exists() {
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response existsWithResponse(Duration timeout, Context context) {
- Mono> response = client.existsWithResponse(context);
-
- return blockWithOptionalTimeout(response, timeout);
+ try {
+ Response response = getPropertiesWithResponse(null, timeout, context);
+ return new SimpleResponse<>(response, true);
+ } catch (RuntimeException e) {
+ if (ModelHelper.checkContainerDoesNotExistStatusCode(e) && e instanceof HttpResponseException) {
+ HttpResponse response = ((HttpResponseException) e).getResponse();
+ return new SimpleResponse<>(response.getRequest(), response.getStatusCode(),
+ response.getHeaders(), false);
+ } else {
+ throw LOGGER.logExceptionAsError(e);
+ }
+ }
}
/**
@@ -317,8 +429,11 @@ public void create() {
@ServiceMethod(returns = ReturnType.SINGLE)
public Response createWithResponse(Map metadata, PublicAccessType accessType,
Duration timeout, Context context) {
- Mono> response = client.createWithResponse(metadata, accessType, context);
- return blockWithOptionalTimeout(response, timeout);
+ Context finalContext = context == null ? Context.NONE : context;
+ Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() -> this.azureBlobStorage.getContainers()
+ .createNoCustomHeadersWithResponse(containerName, null, metadata, accessType, null,
+ blobContainerEncryptionScope, finalContext));
+ return sendRequest(operation, timeout, BlobStorageException.class);
}
/**
@@ -372,8 +487,21 @@ public boolean createIfNotExists() {
@ServiceMethod(returns = ReturnType.SINGLE)
public Response createIfNotExistsWithResponse(BlobContainerCreateOptions options, Duration timeout,
Context context) {
- return StorageImplUtils.blockWithOptionalTimeout(client.
- createIfNotExistsWithResponse(options, context), timeout);
+ BlobContainerCreateOptions finalOptions = options == null ? new BlobContainerCreateOptions() : options;
+ try {
+ Response response = createWithResponse(finalOptions.getMetadata(), finalOptions.getPublicAccessType(),
+ timeout, context);
+ return new SimpleResponse<>(response, true);
+ } catch (BlobStorageException e) {
+ if (e.getStatusCode() == 409 && e.getErrorCode().equals(BlobErrorCode.CONTAINER_ALREADY_EXISTS)) {
+ HttpResponse res = e.getResponse();
+ return new SimpleResponse<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), false);
+ } else {
+ throw LOGGER.logExceptionAsError(e);
+ }
+ } catch (RuntimeException e) {
+ throw LOGGER.logExceptionAsError(e);
+ }
}
/**
@@ -428,9 +556,22 @@ public void delete() {
@ServiceMethod(returns = ReturnType.SINGLE)
public Response deleteWithResponse(BlobRequestConditions requestConditions, Duration timeout,
Context context) {
- Mono> response = client.deleteWithResponse(requestConditions, context);
+ BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions()
+ : requestConditions;
+ if (!ModelHelper.validateNoETag(requestConditions)) {
+ // Throwing is preferred to Mono.error because this will error out immediately instead of waiting until
+ // subscription.
+ throw LOGGER.logExceptionAsError(
+ new UnsupportedOperationException("ETag access conditions are not supported for this API."));
+ }
+ Context finalContext = context == null ? Context.NONE : context;
+
+ Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() ->
+ this.azureBlobStorage.getContainers().deleteNoCustomHeadersWithResponse(containerName, null,
+ finalRequestConditions.getLeaseId(), finalRequestConditions.getIfModifiedSince(),
+ finalRequestConditions.getIfUnmodifiedSince(), null, finalContext));
- return blockWithOptionalTimeout(response, timeout);
+ return sendRequest(operation, timeout, BlobStorageException.class);
}
/**
@@ -485,7 +626,17 @@ public boolean deleteIfExists() {
@ServiceMethod(returns = ReturnType.SINGLE)
public Response deleteIfExistsWithResponse(BlobRequestConditions requestConditions, Duration timeout,
Context context) {
- return blockWithOptionalTimeout(client.deleteIfExistsWithResponse(requestConditions, context), timeout);
+ try {
+ Response response = this.deleteWithResponse(requestConditions, timeout, context);
+ return new SimpleResponse<>(response, true);
+ } catch (BlobStorageException e) {
+ if (e.getStatusCode() == 404 && e.getErrorCode().equals(BlobErrorCode.CONTAINER_NOT_FOUND)) {
+ HttpResponse res = e.getResponse();
+ return new SimpleResponse<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), false);
+ } else {
+ throw LOGGER.logExceptionAsError(e);
+ }
+ }
}
/**
@@ -538,7 +689,20 @@ public BlobContainerProperties getProperties() {
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getPropertiesWithResponse(String leaseId, Duration timeout,
Context context) {
- return blockWithOptionalTimeout(client.getPropertiesWithResponse(leaseId, context), timeout);
+ Context finalContext = context == null ? Context.NONE : context;
+ Callable> operation =
+ wrapTimeoutServiceCallWithExceptionMapping(() ->
+ this.azureBlobStorage.getContainers().getPropertiesWithResponse(containerName, null, leaseId, null,
+ finalContext));
+ ResponseBase response = sendRequest(operation, timeout,
+ BlobStorageException.class);
+ ContainersGetPropertiesHeaders hd = response.getDeserializedHeaders();
+ BlobContainerProperties properties = new BlobContainerProperties(hd.getXMsMeta(), 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(), hd.isXMsImmutableStorageWithVersioningEnabled());
+ return new SimpleResponse<>(response, properties);
}
/**
@@ -595,9 +759,20 @@ public void setMetadata(Map metadata) {
@ServiceMethod(returns = ReturnType.SINGLE)
public Response setMetadataWithResponse(Map metadata,
BlobRequestConditions requestConditions, Duration timeout, Context context) {
- Mono> response = client.setMetadataWithResponse(metadata, requestConditions,
- context);
- return blockWithOptionalTimeout(response, timeout);
+ Context finalContext = context == null ? Context.NONE : context;
+ BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions()
+ : requestConditions;
+ if (!ModelHelper.validateNoETag(finalRequestConditions) || finalRequestConditions.getIfUnmodifiedSince() != null) {
+ // Throwing is preferred to Mono.error because this will error out immediately instead of waiting until
+ // subscription.
+ throw LOGGER.logExceptionAsError(new UnsupportedOperationException(
+ "If-Modified-Since is the only HTTP access condition supported for this API"));
+ }
+ Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() ->
+ azureBlobStorage.getContainers().setMetadataWithResponse(containerName, null,
+ finalRequestConditions.getLeaseId(), metadata, finalRequestConditions.getIfModifiedSince(), null,
+ finalContext));
+ return sendRequest(operation, timeout, BlobStorageException.class);
}
/**
@@ -657,7 +832,15 @@ public BlobContainerAccessPolicies getAccessPolicy() {
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getAccessPolicyWithResponse(String leaseId, Duration timeout,
Context context) {
- return blockWithOptionalTimeout(client.getAccessPolicyWithResponse(leaseId, context), timeout);
+ Context finalContext = context == null ? Context.NONE : context;
+ Callable> operation =
+ wrapTimeoutServiceCallWithExceptionMapping(() ->
+ this.azureBlobStorage.getContainers().getAccessPolicyWithResponse(containerName, null, leaseId, null,
+ finalContext));
+ ResponseBase response = sendRequest(operation,
+ timeout, BlobStorageException.class);
+ return new SimpleResponse<>(response, new BlobContainerAccessPolicies(
+ response.getDeserializedHeaders().getXMsBlobPublicAccess(), response.getValue().items()));
}
/**
@@ -746,10 +929,21 @@ public void setAccessPolicy(PublicAccessType accessType,
public Response setAccessPolicyWithResponse(PublicAccessType accessType,
List identifiers, BlobRequestConditions requestConditions,
Duration timeout, Context context) {
- Mono> response = client
- .setAccessPolicyWithResponse(accessType, identifiers, requestConditions, context);
+ BlobRequestConditions finalRequestConditions = requestConditions == null ? new BlobRequestConditions() : requestConditions;
- return blockWithOptionalTimeout(response, timeout);
+ if (!ModelHelper.validateNoETag(requestConditions)) {
+ // Throwing is preferred to Mono.error because this will error out immediately instead of waiting until
+ // subscription.
+ throw LOGGER.logExceptionAsError(
+ new UnsupportedOperationException("ETag access conditions are not supported for this API."));
+ }
+ List finalIdentifiers = ModelHelper.truncateTimeForBlobSignedIdentifier(identifiers);
+ Context finalContext = context == null ? Context.NONE : context;
+ Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() ->
+ this.azureBlobStorage.getContainers().setAccessPolicyNoCustomHeadersWithResponse(containerName, null,
+ finalRequestConditions.getLeaseId(), accessType, finalRequestConditions.getIfModifiedSince(),
+ finalRequestConditions.getIfUnmodifiedSince(), null, finalIdentifiers, finalContext));
+ return sendRequest(operation, timeout, BlobStorageException.class);
}
/**
@@ -859,7 +1053,42 @@ public PagedIterable listBlobs(ListBlobsOptions options, Duration time
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listBlobs(ListBlobsOptions options, String continuationToken, Duration timeout) {
- return new PagedIterable<>(client.listBlobsFlatWithOptionalTimeout(options, continuationToken, timeout));
+ BiFunction> retriever = (nextMarker, pageSize) -> {
+ ListBlobsOptions finalOptions = options == null ? new ListBlobsOptions() : options;
+ if (pageSize != null) {
+ finalOptions.setMaxResultsPerPage(pageSize);
+ }
+ ArrayList include =
+ finalOptions.getDetails().toList().isEmpty() ? null : finalOptions.getDetails().toList();
+
+ Supplier> operation = () -> {
+ ResponseBase response =
+ wrapServiceCallWithExceptionMapping(() ->
+ this.azureBlobStorage.getContainers().listBlobFlatSegmentWithResponse(containerName,
+ finalOptions.getPrefix(), nextMarker, finalOptions.getMaxResultsPerPage(), include, null,
+ null, Context.NONE));
+
+ List value = response.getValue().getSegment() == null ? Collections.emptyList()
+ : response.getValue().getSegment().getBlobItems().stream()
+ .map(ModelHelper::populateBlobItem)
+ .collect(Collectors.toList());
+
+ return new PagedResponseBase<>(
+ response.getRequest(),
+ response.getStatusCode(),
+ response.getHeaders(),
+ value,
+ response.getValue().getNextMarker(),
+ response.getDeserializedHeaders());
+ };
+ try {
+ return timeout != null ? CoreUtils.getResultWithTimeout(SharedExecutorService.getInstance()
+ .submit(operation::get), timeout) : operation.get();
+ } catch (InterruptedException | ExecutionException | TimeoutException e) {
+ throw LOGGER.logExceptionAsError(new RuntimeException("Failed to retrieve blobs with timeout.", e));
+ }
+ };
+ return new PagedIterable<>(pageSize -> retriever.apply(continuationToken, pageSize), retriever);
}
/**
@@ -954,8 +1183,54 @@ public PagedIterable listBlobsByHierarchy(String directory) {
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listBlobsByHierarchy(String delimiter, ListBlobsOptions options, Duration timeout) {
- return new PagedIterable<>(client
- .listBlobsHierarchyWithOptionalTimeout(delimiter, options, timeout));
+ BiFunction> func = (marker, pageSize) -> {
+ ListBlobsOptions finalOptions;
+ if (pageSize != null) {
+ if (options == null) {
+ finalOptions = new ListBlobsOptions().setMaxResultsPerPage(pageSize);
+ } else {
+ // Note that this prefers the value passed to .byPage(int) over the value on the options
+ finalOptions = new ListBlobsOptions()
+ .setMaxResultsPerPage(pageSize)
+ .setPrefix(options.getPrefix())
+ .setDetails(options.getDetails());
+ }
+ } else {
+ finalOptions = options == null ? new ListBlobsOptions() : options;
+ }
+ return listBlobsHierarchySegment(marker, delimiter, finalOptions, timeout);
+ };
+ return new PagedIterable<>(pageSize -> func.apply(null, pageSize), func);
+ }
+
+ private PagedResponse listBlobsHierarchySegment(String marker, String delimiter, ListBlobsOptions options,
+ Duration timeout) {
+ if (options.getDetails().getRetrieveSnapshots()) {
+ throw LOGGER.logExceptionAsError(
+ new UnsupportedOperationException("Including snapshots in a hierarchical listing is not supported."));
+ }
+ ArrayList include = options.getDetails().toList().isEmpty() ? null
+ : options.getDetails().toList();
+
+ Callable> operation =
+ wrapTimeoutServiceCallWithExceptionMapping(() -> azureBlobStorage.getContainers().listBlobHierarchySegmentWithResponse(containerName, delimiter,
+ options.getPrefix(), marker, options.getMaxResultsPerPage(), include, null, null, Context.NONE));
+
+ ResponseBase response =
+ StorageImplUtils.sendRequest(operation, timeout, BlobStorageException.class);
+
+ BlobHierarchyListSegment segment = response.getValue().getSegment();
+ List value = new ArrayList<>();
+ if (segment != null) {
+ segment.getBlobItems().forEach(item -> value.add(BlobItemConstructorProxy.create(item)));
+ segment.getBlobPrefixes().forEach(prefix -> value.add(new BlobItem()
+ .setName(ModelHelper.toBlobNameString(prefix.getName()))
+ .setIsPrefix(true)));
+ }
+
+ return new PagedResponseBase<>(
+ response.getRequest(), response.getStatusCode(), response.getHeaders(), value,
+ response.getValue().getNextMarker(), response.getDeserializedHeaders());
}
/**
@@ -1003,7 +1278,40 @@ public PagedIterable findBlobsByTags(String query) {
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable findBlobsByTags(FindBlobsOptions options, Duration timeout, Context context) {
- return new PagedIterable<>(client.findBlobsByTags(options, timeout, context));
+ StorageImplUtils.assertNotNull("options", options);
+ BiFunction> func = (marker, pageSize) -> {
+ // Use pageSize if provided, otherwise use maxResultsPerPage from options
+ FindBlobsOptions finalOptions = (pageSize != null)
+ ? new FindBlobsOptions(options.getQuery()).setMaxResultsPerPage(pageSize) : options;
+
+ return findBlobsByTagsHelper(finalOptions, marker, timeout, context);
+ };
+ return new PagedIterable<>(pageSize -> func.apply(null, pageSize), func);
+ }
+
+ private PagedResponse findBlobsByTagsHelper(
+ FindBlobsOptions options, String marker,
+ Duration timeout, Context context) {
+ Callable> operation =
+ wrapTimeoutServiceCallWithExceptionMapping(() ->
+ this.azureBlobStorage.getContainers().filterBlobsWithResponse(
+ containerName, null, null, options.getQuery(), marker,
+ options.getMaxResultsPerPage(), null, context));
+
+ ResponseBase response =
+ StorageImplUtils.sendRequest(operation, timeout, BlobStorageException.class);
+
+ List value = response.getValue().getBlobs().stream()
+ .map(ModelHelper::populateTaggedBlobItem)
+ .collect(Collectors.toList());
+
+ return new PagedResponseBase<>(
+ response.getRequest(),
+ response.getStatusCode(),
+ response.getHeaders(),
+ value,
+ response.getValue().getNextMarker(),
+ response.getDeserializedHeaders());
}
/**
@@ -1047,9 +1355,14 @@ public StorageAccountInfo getAccountInfo(Duration timeout) {
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getAccountInfoWithResponse(Duration timeout, Context context) {
- Mono> response = client.getAccountInfoWithResponse(context);
-
- return blockWithOptionalTimeout(response, timeout);
+ Context finalContext = context == null ? Context.NONE : context;
+ Callable> operation =
+ wrapTimeoutServiceCallWithExceptionMapping(() ->
+ this.azureBlobStorage.getContainers().getAccountInfoWithResponse(containerName, finalContext));
+ ResponseBase response = sendRequest(operation, timeout,
+ BlobStorageException.class);
+ ContainersGetAccountInfoHeaders hd = response.getDeserializedHeaders();
+ return new SimpleResponse<>(response, new StorageAccountInfo(hd.getXMsSkuName(), hd.getXMsAccountKind()));
}
// TODO: Reintroduce this API once service starts supporting it.
@@ -1094,7 +1407,8 @@ public Response getAccountInfoWithResponse(Duration timeout,
*/
public String generateUserDelegationSas(BlobServiceSasSignatureValues blobServiceSasSignatureValues,
UserDelegationKey userDelegationKey) {
- return this.client.generateUserDelegationSas(blobServiceSasSignatureValues, userDelegationKey);
+ return generateUserDelegationSas(blobServiceSasSignatureValues, userDelegationKey, getAccountName(),
+ Context.NONE);
}
/**
@@ -1147,8 +1461,8 @@ public String generateUserDelegationSas(BlobServiceSasSignatureValues blobServic
*/
public String generateUserDelegationSas(BlobServiceSasSignatureValues blobServiceSasSignatureValues,
UserDelegationKey userDelegationKey, String accountName, Consumer stringToSignHandler, Context context) {
- return this.client.generateUserDelegationSas(blobServiceSasSignatureValues, userDelegationKey, accountName,
- stringToSignHandler, context);
+ return new BlobSasImplUtil(blobServiceSasSignatureValues, getBlobContainerName())
+ .generateUserDelegationSas(userDelegationKey, accountName, stringToSignHandler, context);
}
/**
@@ -1175,7 +1489,7 @@ public String generateUserDelegationSas(BlobServiceSasSignatureValues blobServic
* @return A {@code String} representing the SAS query parameters.
*/
public String generateSas(BlobServiceSasSignatureValues blobServiceSasSignatureValues) {
- return this.client.generateSas(blobServiceSasSignatureValues);
+ return generateSas(blobServiceSasSignatureValues, Context.NONE);
}
/**
@@ -1221,7 +1535,8 @@ public String generateSas(BlobServiceSasSignatureValues blobServiceSasSignatureV
*/
public String generateSas(BlobServiceSasSignatureValues blobServiceSasSignatureValues,
Consumer stringToSignHandler, Context context) {
- return this.client.generateSas(blobServiceSasSignatureValues, stringToSignHandler, context);
+ return new BlobSasImplUtil(blobServiceSasSignatureValues, getBlobContainerName())
+ .generateSas(SasImplUtils.extractSharedKeyCredential(getHttpPipeline()), stringToSignHandler, context);
}
}
diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClientBuilder.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClientBuilder.java
index cd4f9e8f9b574..28c1f10752476 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClientBuilder.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobContainerClientBuilder.java
@@ -121,7 +121,26 @@ public BlobContainerClientBuilder() {
* @throws IllegalStateException If multiple credentials have been specified.
*/
public BlobContainerClient buildClient() {
- return new BlobContainerClient(buildAsyncClient());
+ BuilderHelper.httpsValidation(customerProvidedKey, "customer provided key", endpoint, LOGGER);
+
+ if (Objects.nonNull(customerProvidedKey) && Objects.nonNull(encryptionScope)) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException("Customer provided key and encryption "
+ + "scope cannot both be set"));
+ }
+
+ /*
+ Implicit and explicit root container access are functionally equivalent, but explicit references are easier
+ to read and debug.
+ */
+ String blobContainerName = CoreUtils.isNullOrEmpty(containerName) ? BlobContainerClient.ROOT_CONTAINER_NAME
+ : containerName;
+
+ BlobServiceVersion serviceVersion = version != null ? version : BlobServiceVersion.getLatest();
+
+ HttpPipeline pipeline = constructPipeline();
+
+ return new BlobContainerClient(pipeline, endpoint, serviceVersion, accountName, blobContainerName,
+ customerProvidedKey, encryptionScope, blobContainerEncryptionScope);
}
/**
@@ -160,15 +179,19 @@ public BlobContainerAsyncClient buildAsyncClient() {
BlobServiceVersion serviceVersion = version != null ? version : BlobServiceVersion.getLatest();
- HttpPipeline pipeline = (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline(
- storageSharedKeyCredential, tokenCredential, azureSasCredential, sasToken,
- endpoint, retryOptions, coreRetryOptions, logOptions,
- clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, audience, LOGGER);
+ HttpPipeline pipeline = constructPipeline();
return new BlobContainerAsyncClient(pipeline, endpoint, serviceVersion, accountName, blobContainerName,
customerProvidedKey, encryptionScope, blobContainerEncryptionScope);
}
+ private HttpPipeline constructPipeline() {
+ return (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline(
+ storageSharedKeyCredential, tokenCredential, azureSasCredential, sasToken,
+ endpoint, retryOptions, coreRetryOptions, logOptions,
+ clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, audience, LOGGER);
+ }
+
/**
* Sets the service endpoint, additionally parses it for information (SAS token, container name)
*
diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java
index 3842d2b3e6213..cec9e88890e46 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceAsyncClient.java
@@ -25,15 +25,12 @@
import com.azure.storage.blob.implementation.util.ModelHelper;
import com.azure.storage.blob.models.BlobContainerEncryptionScope;
import com.azure.storage.blob.models.BlobContainerItem;
-import com.azure.storage.blob.models.BlobContainerListDetails;
import com.azure.storage.blob.models.BlobCorsRule;
-import com.azure.storage.blob.models.BlobRetentionPolicy;
import com.azure.storage.blob.models.BlobServiceProperties;
import com.azure.storage.blob.models.BlobServiceStatistics;
import com.azure.storage.blob.models.BlobStorageException;
import com.azure.storage.blob.models.CpkInfo;
import com.azure.storage.blob.models.KeyInfo;
-import com.azure.storage.blob.models.ListBlobContainersIncludeType;
import com.azure.storage.blob.models.ListBlobContainersOptions;
import com.azure.storage.blob.models.PublicAccessType;
import com.azure.storage.blob.models.StorageAccountInfo;
@@ -179,6 +176,22 @@ public BlobServiceVersion getServiceVersion() {
return serviceVersion;
}
+ CpkInfo getCustomerProvidedKey() {
+ return customerProvidedKey;
+ }
+
+ EncryptionScope getEncryptionScope() {
+ return encryptionScope;
+ }
+
+ BlobContainerEncryptionScope getBlobContainerEncryptionScope() {
+ return blobContainerEncryptionScope;
+ }
+
+ boolean isAnonymousAccess() {
+ return anonymousAccess;
+ }
+
/**
* Creates a new container within a storage account. If a container with the same name already exists, the operation
* fails. For more information, see the
@@ -538,7 +551,7 @@ private Mono> listBlobContainersSegment(String
return StorageImplUtils.applyOptionalTimeout(
this.azureBlobStorage.getServices().listBlobContainersSegmentSinglePageAsync(
options.getPrefix(), marker, options.getMaxResultsPerPage(),
- toIncludeTypes(options.getDetails()),
+ ModelHelper.toIncludeTypes(options.getDetails()),
null, null, Context.NONE), timeout);
}
@@ -628,35 +641,6 @@ private Mono> findBlobsByTags(
});
}
- /**
- * Converts {@link BlobContainerListDetails} into list of {@link ListBlobContainersIncludeType}
- * that contains only options selected. If no option is selected then null is returned.
- *
- * @return a list of selected options converted into {@link ListBlobContainersIncludeType}, null if none
- * of options has been selected.
- */
- private List toIncludeTypes(BlobContainerListDetails blobContainerListDetails) {
- boolean hasDetails = blobContainerListDetails != null
- && (blobContainerListDetails.getRetrieveMetadata()
- || blobContainerListDetails.getRetrieveDeleted()
- || blobContainerListDetails.getRetrieveSystemContainers());
- if (hasDetails) {
- List flags = new ArrayList<>(3);
- if (blobContainerListDetails.getRetrieveDeleted()) {
- flags.add(ListBlobContainersIncludeType.DELETED);
- }
- if (blobContainerListDetails.getRetrieveMetadata()) {
- flags.add(ListBlobContainersIncludeType.METADATA);
- }
- if (blobContainerListDetails.getRetrieveSystemContainers()) {
- flags.add(ListBlobContainersIncludeType.SYSTEM);
- }
- return flags;
- } else {
- return null;
- }
- }
-
/**
* Gets the properties of a storage account’s Blob service. For more information, see the
* Azure Docs.
@@ -807,14 +791,14 @@ Mono> setPropertiesWithResponse(BlobServiceProperties properties,
finalProperties.setLogging(properties.getLogging());
if (finalProperties.getLogging() != null) {
StorageImplUtils.assertNotNull("Logging Version", finalProperties.getLogging().getVersion());
- validateRetentionPolicy(finalProperties.getLogging().getRetentionPolicy(), "Logging Retention Policy");
+ ModelHelper.validateRetentionPolicy(finalProperties.getLogging().getRetentionPolicy(), "Logging Retention Policy");
}
// Hour Metrics
finalProperties.setHourMetrics(properties.getHourMetrics());
if (finalProperties.getHourMetrics() != null) {
StorageImplUtils.assertNotNull("HourMetrics Version", finalProperties.getHourMetrics().getVersion());
- validateRetentionPolicy(finalProperties.getHourMetrics().getRetentionPolicy(), "HourMetrics Retention "
+ ModelHelper.validateRetentionPolicy(finalProperties.getHourMetrics().getRetentionPolicy(), "HourMetrics Retention "
+ "Policy");
if (finalProperties.getHourMetrics().isEnabled()) {
StorageImplUtils.assertNotNull("HourMetrics IncludeApis",
@@ -827,7 +811,7 @@ Mono> setPropertiesWithResponse(BlobServiceProperties properties,
if (finalProperties.getMinuteMetrics() != null) {
StorageImplUtils.assertNotNull("MinuteMetrics Version",
finalProperties.getMinuteMetrics().getVersion());
- validateRetentionPolicy(finalProperties.getMinuteMetrics().getRetentionPolicy(), "MinuteMetrics "
+ ModelHelper.validateRetentionPolicy(finalProperties.getMinuteMetrics().getRetentionPolicy(), "MinuteMetrics "
+ "Retention Policy");
if (finalProperties.getMinuteMetrics().isEnabled()) {
StorageImplUtils.assertNotNull("MinuteMetrics IncludeApis",
@@ -838,7 +822,7 @@ Mono> setPropertiesWithResponse(BlobServiceProperties properties,
// CORS
List corsRules = new ArrayList<>();
for (BlobCorsRule rule : properties.getCors()) {
- corsRules.add(validatedCorsRule(rule));
+ corsRules.add(ModelHelper.validatedCorsRule(rule));
}
finalProperties.setCors(corsRules);
@@ -847,7 +831,7 @@ Mono> setPropertiesWithResponse(BlobServiceProperties properties,
// Delete Retention Policy
finalProperties.setDeleteRetentionPolicy(properties.getDeleteRetentionPolicy());
- validateRetentionPolicy(finalProperties.getDeleteRetentionPolicy(), "DeleteRetentionPolicy Days");
+ ModelHelper.validateRetentionPolicy(finalProperties.getDeleteRetentionPolicy(), "DeleteRetentionPolicy Days");
// Static Website
finalProperties.setStaticWebsite(properties.getStaticWebsite());
@@ -859,38 +843,6 @@ Mono> setPropertiesWithResponse(BlobServiceProperties properties,
.setPropertiesNoCustomHeadersWithResponseAsync(finalProperties, null, null, context);
}
- /**
- * Sets any null fields to "" since the service requires all Cors rules to be set if some are set.
- * @param originalRule {@link BlobCorsRule}
- * @return The validated {@link BlobCorsRule}
- */
- private BlobCorsRule validatedCorsRule(BlobCorsRule originalRule) {
- if (originalRule == null) {
- return null;
- }
- BlobCorsRule validRule = new BlobCorsRule();
- validRule.setAllowedHeaders(StorageImplUtils.emptyIfNull(originalRule.getAllowedHeaders()));
- validRule.setAllowedMethods(StorageImplUtils.emptyIfNull(originalRule.getAllowedMethods()));
- validRule.setAllowedOrigins(StorageImplUtils.emptyIfNull(originalRule.getAllowedOrigins()));
- validRule.setExposedHeaders(StorageImplUtils.emptyIfNull(originalRule.getExposedHeaders()));
- validRule.setMaxAgeInSeconds(originalRule.getMaxAgeInSeconds());
- return validRule;
- }
-
- /**
- * Validates a {@link BlobRetentionPolicy} according to service specs for set properties.
- * @param retentionPolicy {@link BlobRetentionPolicy}
- * @param policyName The name of the variable for errors.
- */
- private void validateRetentionPolicy(BlobRetentionPolicy retentionPolicy, String policyName) {
- if (retentionPolicy == null) {
- return;
- }
- if (retentionPolicy.isEnabled()) {
- StorageImplUtils.assertInBounds(policyName, retentionPolicy.getDays(), 1, 365);
- }
- }
-
/**
* Gets a user delegation key for use with this account's blob storage. Note: This method call is only valid when
* using {@link TokenCredential} in this object's {@link HttpPipeline}.
diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java
index 2c85fafd7d457..f6743e2815ae9 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClient.java
@@ -9,12 +9,35 @@
import com.azure.core.credential.TokenCredential;
import com.azure.core.http.HttpPipeline;
import com.azure.core.http.rest.PagedIterable;
+import com.azure.core.http.rest.PagedResponse;
+import com.azure.core.http.rest.PagedResponseBase;
import com.azure.core.http.rest.Response;
+import com.azure.core.http.rest.ResponseBase;
import com.azure.core.http.rest.SimpleResponse;
import com.azure.core.util.Context;
+import com.azure.core.util.CoreUtils;
+import com.azure.core.util.logging.ClientLogger;
+import com.azure.storage.blob.implementation.AzureBlobStorageImpl;
+import com.azure.storage.blob.implementation.AzureBlobStorageImplBuilder;
+import com.azure.storage.blob.implementation.models.ContainersRestoreHeaders;
+import com.azure.storage.blob.implementation.models.EncryptionScope;
+import com.azure.storage.blob.implementation.models.FilterBlobSegment;
+import com.azure.storage.blob.implementation.models.ServicesFilterBlobsHeaders;
+import com.azure.storage.blob.implementation.models.ServicesGetAccountInfoHeaders;
+import com.azure.storage.blob.implementation.models.ServicesGetPropertiesHeaders;
+import com.azure.storage.blob.implementation.models.ServicesGetStatisticsHeaders;
+import com.azure.storage.blob.implementation.models.ServicesGetUserDelegationKeyHeaders;
+import com.azure.storage.blob.implementation.util.ModelHelper;
+import com.azure.storage.blob.models.BlobContainerEncryptionScope;
import com.azure.storage.blob.models.BlobContainerItem;
+import com.azure.storage.blob.models.BlobContainerListDetails;
+import com.azure.storage.blob.models.BlobCorsRule;
import com.azure.storage.blob.models.BlobServiceProperties;
import com.azure.storage.blob.models.BlobServiceStatistics;
+import com.azure.storage.blob.models.BlobStorageException;
+import com.azure.storage.blob.models.CpkInfo;
+import com.azure.storage.blob.models.KeyInfo;
+import com.azure.storage.blob.models.ListBlobContainersIncludeType;
import com.azure.storage.blob.models.ListBlobContainersOptions;
import com.azure.storage.blob.models.PublicAccessType;
import com.azure.storage.blob.models.StorageAccountInfo;
@@ -24,13 +47,24 @@
import com.azure.storage.blob.options.FindBlobsOptions;
import com.azure.storage.blob.options.UndeleteBlobContainerOptions;
import com.azure.storage.common.StorageSharedKeyCredential;
+import com.azure.storage.common.implementation.AccountSasImplUtil;
+import com.azure.storage.common.implementation.Constants;
+import com.azure.storage.common.implementation.SasImplUtils;
import com.azure.storage.common.implementation.StorageImplUtils;
import com.azure.storage.common.sas.AccountSasSignatureValues;
-import reactor.core.publisher.Mono;
+import java.net.URI;
import java.time.Duration;
import java.time.OffsetDateTime;
+import java.util.ArrayList;
+import java.util.List;
import java.util.Map;
+import java.util.concurrent.Callable;
+import java.util.function.BiFunction;
+import java.util.stream.Collectors;
+
+import static com.azure.storage.blob.implementation.util.ModelHelper.wrapTimeoutServiceCallWithExceptionMapping;
+import static com.azure.storage.common.implementation.StorageImplUtils.sendRequest;
import java.util.function.Consumer;
/**
@@ -48,15 +82,51 @@
*/
@ServiceClient(builder = BlobServiceClientBuilder.class)
public final class BlobServiceClient {
- private final BlobServiceAsyncClient blobServiceAsyncClient;
+ private static final ClientLogger LOGGER = new ClientLogger(BlobServiceClient.class);
+ private final AzureBlobStorageImpl azureBlobStorage;
+ private final String accountName;
+ private final BlobServiceVersion serviceVersion;
+ private final CpkInfo customerProvidedKey; // only used to pass down to blob clients
+ private final EncryptionScope encryptionScope; // only used to pass down to blob clients
+ private final BlobContainerEncryptionScope blobContainerEncryptionScope; // only used to pass down to container
+ // clients
+ private final boolean anonymousAccess;
/**
* Package-private constructor for use by {@link BlobServiceClientBuilder}.
*
- * @param blobServiceAsyncClient the async storage account client
+ * @param pipeline The pipeline used to send and receive service requests.
+ * @param url The endpoint where to send service requests.
+ * @param serviceVersion The version of the service to receive requests.
+ * @param accountName The storage account name.
+ * @param customerProvidedKey Customer provided key used during encryption of the blob's data on the server, pass
+ * {@code null} to allow the service to use its own encryption.
+ * @param encryptionScope Encryption scope used during encryption of the blob's data on the server, pass
+ * {@code null} to allow the service to use its own encryption.
+ * @param anonymousAccess Whether the client was built with anonymousAccess
*/
- BlobServiceClient(BlobServiceAsyncClient blobServiceAsyncClient) {
- this.blobServiceAsyncClient = blobServiceAsyncClient;
+ BlobServiceClient(HttpPipeline pipeline, String url,
+ BlobServiceVersion serviceVersion, String accountName, CpkInfo customerProvidedKey, EncryptionScope encryptionScope,
+ BlobContainerEncryptionScope blobContainerEncryptionScope, boolean anonymousAccess) {
+ /* Check to make sure the uri is valid. We don't want the error to occur later in the generated layer
+ when the sas token has already been applied. */
+ try {
+ URI.create(url);
+ } catch (IllegalArgumentException ex) {
+ throw LOGGER.logExceptionAsError(ex);
+ }
+ this.azureBlobStorage = new AzureBlobStorageImplBuilder()
+ .pipeline(pipeline)
+ .url(url)
+ .version(serviceVersion.getVersion())
+ .buildClient();
+ this.serviceVersion = serviceVersion;
+
+ this.accountName = accountName;
+ this.customerProvidedKey = customerProvidedKey;
+ this.encryptionScope = encryptionScope;
+ this.blobContainerEncryptionScope = blobContainerEncryptionScope;
+ this.anonymousAccess = anonymousAccess;
}
/**
@@ -75,7 +145,11 @@ public final class BlobServiceClient {
* @return A {@link BlobContainerClient} object pointing to the specified container
*/
public BlobContainerClient getBlobContainerClient(String containerName) {
- return new BlobContainerClient(blobServiceAsyncClient.getBlobContainerAsyncClient(containerName));
+ if (CoreUtils.isNullOrEmpty(containerName)) {
+ containerName = BlobContainerAsyncClient.ROOT_CONTAINER_NAME;
+ }
+ return new BlobContainerClient(getHttpPipeline(), getAccountUrl(), getServiceVersion(),
+ getAccountName(), containerName, customerProvidedKey, encryptionScope, blobContainerEncryptionScope);
}
/**
@@ -84,7 +158,7 @@ public BlobContainerClient getBlobContainerClient(String containerName) {
* @return The pipeline.
*/
public HttpPipeline getHttpPipeline() {
- return blobServiceAsyncClient.getHttpPipeline();
+ return azureBlobStorage.getHttpPipeline();
}
/**
@@ -93,7 +167,7 @@ public HttpPipeline getHttpPipeline() {
* @return the service version the client is using.
*/
public BlobServiceVersion getServiceVersion() {
- return this.blobServiceAsyncClient.getServiceVersion();
+ return serviceVersion;
}
/**
@@ -247,7 +321,7 @@ public void deleteBlobContainer(String containerName) {
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response deleteBlobContainerWithResponse(String containerName, Context context) {
- return blobServiceAsyncClient.deleteBlobContainerWithResponse(containerName, context).block();
+ return getBlobContainerClient(containerName).deleteWithResponse(null, null, context);
}
/**
@@ -299,7 +373,7 @@ public boolean deleteBlobContainerIfExists(String containerName) {
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response deleteBlobContainerIfExistsWithResponse(String containerName, Context context) {
- return blobServiceAsyncClient.deleteBlobContainerIfExistsWithResponse(containerName, context).block();
+ return getBlobContainerClient(containerName).deleteIfExistsWithResponse(null, null, context);
}
/**
@@ -308,7 +382,7 @@ public Response deleteBlobContainerIfExistsWithResponse(String containe
* @return the URL.
*/
public String getAccountUrl() {
- return blobServiceAsyncClient.getAccountUrl();
+ return azureBlobStorage.getUrl();
}
/**
@@ -356,7 +430,26 @@ public PagedIterable listBlobContainers() {
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable listBlobContainers(ListBlobContainersOptions options, Duration timeout) {
- return new PagedIterable<>(blobServiceAsyncClient.listBlobContainersWithOptionalTimeout(options, timeout));
+ throwOnAnonymousAccess();
+ BiFunction> pageRetriever = (marker, pageSize) -> {
+ ListBlobContainersOptions finalOptions = options != null ? options : new ListBlobContainersOptions();
+ Integer finalPageSize = pageSize != null ? pageSize : finalOptions.getMaxResultsPerPage();
+ return listBlobContainersSegment(marker, finalOptions.getDetails(), finalOptions.getPrefix(), finalPageSize,
+ timeout);
+ };
+ return new PagedIterable<>(pageSize -> pageRetriever.apply(null, pageSize), pageRetriever);
+
+ }
+
+ private PagedResponse listBlobContainersSegment(String marker, BlobContainerListDetails details,
+ String prefix, Integer maxResultsPerPage, Duration timeout) {
+ // Set up the include types based on the details provided in the options
+ List include = ModelHelper.toIncludeTypes(details);
+
+ Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() ->
+ this.azureBlobStorage.getServices().listBlobContainersSegmentSinglePage(prefix, marker, maxResultsPerPage,
+ include, null, null, Context.NONE));
+ return sendRequest(operation, timeout, BlobStorageException.class);
}
/**
@@ -403,7 +496,40 @@ public PagedIterable findBlobsByTags(String query) {
*/
@ServiceMethod(returns = ReturnType.COLLECTION)
public PagedIterable findBlobsByTags(FindBlobsOptions options, Duration timeout, Context context) {
- return new PagedIterable<>(blobServiceAsyncClient.findBlobsByTags(options, timeout, context));
+ throwOnAnonymousAccess();
+ StorageImplUtils.assertNotNull("options", options);
+ BiFunction> func = (marker, pageSize) -> {
+ FindBlobsOptions finalOptions = (pageSize != null)
+ ? new FindBlobsOptions(options.getQuery()).setMaxResultsPerPage(pageSize) : options;
+ return findBlobsByTagsHelper(finalOptions, marker, timeout, context);
+ };
+ return new PagedIterable<>(pageSize -> func.apply(null, pageSize), func);
+ }
+
+ private PagedResponse findBlobsByTagsHelper(FindBlobsOptions options, String marker,
+ Duration timeout, Context context) {
+ Context finalContext = context == null ? Context.NONE : context;
+
+ StorageImplUtils.assertNotNull("options", options);
+ Callable> operation =
+ wrapTimeoutServiceCallWithExceptionMapping(() ->
+ this.azureBlobStorage.getServices().filterBlobsWithResponse(null, null, options.getQuery(), marker,
+ options.getMaxResultsPerPage(), null, finalContext));
+
+ ResponseBase response =
+ StorageImplUtils.sendRequest(operation, timeout, BlobStorageException.class);
+
+ List value = response.getValue().getBlobs().stream()
+ .map(ModelHelper::populateTaggedBlobItem)
+ .collect(Collectors.toList());
+
+ return new PagedResponseBase<>(
+ response.getRequest(),
+ response.getStatusCode(),
+ response.getHeaders(),
+ value,
+ response.getValue().getNextMarker(),
+ response.getDeserializedHeaders());
}
/**
@@ -452,10 +578,15 @@ public BlobServiceProperties getProperties() {
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getPropertiesWithResponse(Duration timeout, Context context) {
+ Context finalContext = context == null ? Context.NONE : context;
+ throwOnAnonymousAccess();
+ Callable> operation =
+ wrapTimeoutServiceCallWithExceptionMapping(() ->
+ this.azureBlobStorage.getServices().getPropertiesWithResponse(null, null, finalContext));
+ ResponseBase response =
+ StorageImplUtils.sendRequest(operation, timeout, BlobStorageException.class);
- Mono> response = blobServiceAsyncClient.getPropertiesWithResponse(context);
-
- return StorageImplUtils.blockWithOptionalTimeout(response, timeout);
+ return new SimpleResponse<>(response, response.getValue());
}
/**
@@ -553,9 +684,67 @@ public void setProperties(BlobServiceProperties properties) {
@ServiceMethod(returns = ReturnType.SINGLE)
public Response setPropertiesWithResponse(BlobServiceProperties properties, Duration timeout,
Context context) {
- Mono> response = blobServiceAsyncClient.setPropertiesWithResponse(properties, context);
+ throwOnAnonymousAccess();
+ BlobServiceProperties finalProperties;
+ if (properties != null) {
+ finalProperties = new BlobServiceProperties();
+
+ // Logging
+ finalProperties.setLogging(properties.getLogging());
+ if (finalProperties.getLogging() != null) {
+ StorageImplUtils.assertNotNull("Logging Version", finalProperties.getLogging().getVersion());
+ ModelHelper.validateRetentionPolicy(finalProperties.getLogging().getRetentionPolicy(), "Logging Retention Policy");
+ }
- return StorageImplUtils.blockWithOptionalTimeout(response, timeout);
+ // Hour Metrics
+ finalProperties.setHourMetrics(properties.getHourMetrics());
+ if (finalProperties.getHourMetrics() != null) {
+ StorageImplUtils.assertNotNull("HourMetrics Version", finalProperties.getHourMetrics().getVersion());
+ ModelHelper.validateRetentionPolicy(finalProperties.getHourMetrics().getRetentionPolicy(), "HourMetrics Retention "
+ + "Policy");
+ if (finalProperties.getHourMetrics().isEnabled()) {
+ StorageImplUtils.assertNotNull("HourMetrics IncludeApis",
+ finalProperties.getHourMetrics().isIncludeApis());
+ }
+ }
+
+ // Minute Metrics
+ finalProperties.setMinuteMetrics(properties.getMinuteMetrics());
+ if (finalProperties.getMinuteMetrics() != null) {
+ StorageImplUtils.assertNotNull("MinuteMetrics Version",
+ finalProperties.getMinuteMetrics().getVersion());
+ ModelHelper.validateRetentionPolicy(finalProperties.getMinuteMetrics().getRetentionPolicy(), "MinuteMetrics "
+ + "Retention Policy");
+ if (finalProperties.getMinuteMetrics().isEnabled()) {
+ StorageImplUtils.assertNotNull("MinuteMetrics IncludeApis",
+ finalProperties.getHourMetrics().isIncludeApis());
+ }
+ }
+
+ // CORS
+ List corsRules = new ArrayList<>();
+ for (BlobCorsRule rule : properties.getCors()) {
+ corsRules.add(ModelHelper.validatedCorsRule(rule));
+ }
+ finalProperties.setCors(corsRules);
+
+ // Default Service Version
+ finalProperties.setDefaultServiceVersion(properties.getDefaultServiceVersion());
+
+ // Delete Retention Policy
+ finalProperties.setDeleteRetentionPolicy(properties.getDeleteRetentionPolicy());
+ ModelHelper.validateRetentionPolicy(finalProperties.getDeleteRetentionPolicy(), "DeleteRetentionPolicy Days");
+
+ // Static Website
+ finalProperties.setStaticWebsite(properties.getStaticWebsite());
+ } else {
+ finalProperties = null;
+ }
+ Context finalContext = context == null ? Context.NONE : context;
+ Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(() ->
+ this.azureBlobStorage.getServices().setPropertiesNoCustomHeadersWithResponse(finalProperties, null, null,
+ finalContext));
+ return sendRequest(operation, timeout, BlobStorageException.class);
}
/**
@@ -602,10 +791,21 @@ public UserDelegationKey getUserDelegationKey(OffsetDateTime start, OffsetDateTi
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getUserDelegationKeyWithResponse(OffsetDateTime start, OffsetDateTime expiry,
Duration timeout, Context context) {
- Mono> response = blobServiceAsyncClient.getUserDelegationKeyWithResponse(start,
- expiry, context);
-
- return StorageImplUtils.blockWithOptionalTimeout(response, timeout);
+ StorageImplUtils.assertNotNull("expiry", expiry);
+ if (start != null && !start.isBefore(expiry)) {
+ throw LOGGER.logExceptionAsError(
+ new IllegalArgumentException("`start` must be null or a datetime before `expiry`."));
+ }
+ throwOnAnonymousAccess();
+ Context finalContext = context == null ? Context.NONE : context;
+ Callable> operation =
+ wrapTimeoutServiceCallWithExceptionMapping(() ->
+ this.azureBlobStorage.getServices().getUserDelegationKeyWithResponse(new KeyInfo()
+ .setStart(start == null ? "" : Constants.ISO_8601_UTC_DATE_FORMATTER.format(start))
+ .setExpiry(Constants.ISO_8601_UTC_DATE_FORMATTER.format(expiry)), null, null, finalContext));
+ ResponseBase response = sendRequest(operation, timeout,
+ BlobStorageException.class);
+ return new SimpleResponse<>(response, response.getValue());
}
/**
@@ -651,9 +851,12 @@ public BlobServiceStatistics getStatistics() {
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getStatisticsWithResponse(Duration timeout, Context context) {
- Mono> response = blobServiceAsyncClient.getStatisticsWithResponse(context);
-
- return StorageImplUtils.blockWithOptionalTimeout(response, timeout);
+ throwOnAnonymousAccess();
+ Context finalContext = context == null ? Context.NONE : context;
+ Callable> operation =
+ wrapTimeoutServiceCallWithExceptionMapping(() ->
+ this.azureBlobStorage.getServices().getStatisticsWithResponse(null, null, finalContext));
+ return sendRequest(operation, timeout, BlobStorageException.class);
}
/**
@@ -687,9 +890,16 @@ public StorageAccountInfo getAccountInfo() {
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Response getAccountInfoWithResponse(Duration timeout, Context context) {
- Mono> response = blobServiceAsyncClient.getAccountInfoWithResponse(context);
-
- return StorageImplUtils.blockWithOptionalTimeout(response, timeout);
+ throwOnAnonymousAccess();
+ Context finalContext = context == null ? Context.NONE : context;
+ Callable> operation =
+ wrapTimeoutServiceCallWithExceptionMapping(() ->
+ this.azureBlobStorage.getServices().getAccountInfoWithResponse(finalContext));
+ ResponseBase response = sendRequest(operation, timeout,
+ BlobStorageException.class);
+ ServicesGetAccountInfoHeaders hd = response.getDeserializedHeaders();
+ return new SimpleResponse<>(response, new StorageAccountInfo(hd.getXMsSkuName(), hd.getXMsAccountKind(),
+ hd.isXMsIsHnsEnabled()));
}
/**
@@ -698,7 +908,17 @@ public Response getAccountInfoWithResponse(Duration timeout,
* @return account name associated with this storage resource.
*/
public String getAccountName() {
- return this.blobServiceAsyncClient.getAccountName();
+ return this.accountName;
+ }
+
+ /**
+ * Checks if service client was built with credentials.
+ */
+ private void throwOnAnonymousAccess() {
+ if (anonymousAccess) {
+ throw LOGGER.logExceptionAsError(new IllegalStateException("Service client cannot be accessed without "
+ + "credentials"));
+ }
}
/**
@@ -731,7 +951,7 @@ public String getAccountName() {
* @return A {@code String} representing the SAS query parameters.
*/
public String generateAccountSas(AccountSasSignatureValues accountSasSignatureValues) {
- return this.blobServiceAsyncClient.generateAccountSas(accountSasSignatureValues);
+ return generateAccountSas(accountSasSignatureValues, Context.NONE);
}
/* TODO(gapra): REST Docs*/
@@ -783,7 +1003,10 @@ public String generateAccountSas(AccountSasSignatureValues accountSasSignatureVa
*/
public String generateAccountSas(AccountSasSignatureValues accountSasSignatureValues,
Consumer stringToSignHandler, Context context) {
- return this.blobServiceAsyncClient.generateAccountSas(accountSasSignatureValues, stringToSignHandler, context);
+ throwOnAnonymousAccess();
+ return new AccountSasImplUtil(accountSasSignatureValues,
+ this.encryptionScope == null ? null : this.encryptionScope.getEncryptionScope())
+ .generateSas(SasImplUtils.extractSharedKeyCredential(getHttpPipeline()), stringToSignHandler, context);
}
/**
@@ -851,13 +1074,21 @@ public BlobContainerClient undeleteBlobContainer(String deletedContainerName, St
* to interact with the restored container.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Response undeleteBlobContainerWithResponse(
- UndeleteBlobContainerOptions options, Duration timeout, Context context) {
- Mono> response =
- this.blobServiceAsyncClient.undeleteBlobContainerWithResponse(options, context)
- .map(r -> new SimpleResponse<>(r, getBlobContainerClient(r.getValue().getBlobContainerName())));
-
- return StorageImplUtils.blockWithOptionalTimeout(response, timeout);
+ public Response undeleteBlobContainerWithResponse(UndeleteBlobContainerOptions options,
+ Duration timeout, Context context) {
+ StorageImplUtils.assertNotNull("options", options);
+ boolean hasOptionalDestinationContainerName = options.getDestinationContainerName() != null;
+ String finalDestinationContainerName =
+ hasOptionalDestinationContainerName ? options.getDestinationContainerName()
+ : options.getDeletedContainerName();
+ Context finalContext = context == null ? Context.NONE : context;
+ Callable> operation = wrapTimeoutServiceCallWithExceptionMapping(
+ () ->
+ this.azureBlobStorage.getContainers().restoreWithResponse(finalDestinationContainerName, null, null,
+ options.getDeletedContainerName(), options.getDeletedContainerVersion(), finalContext));
+ ResponseBase response = sendRequest(operation, timeout,
+ BlobStorageException.class);
+ return new SimpleResponse<>(response, getBlobContainerClient(finalDestinationContainerName));
}
// /**
diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClientBuilder.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClientBuilder.java
index 226f3b6dc903d..663ad41d0cbe0 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClientBuilder.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceClientBuilder.java
@@ -96,6 +96,7 @@ public final class BlobServiceClientBuilder implements
private Configuration configuration;
private BlobServiceVersion version;
private BlobAudience audience;
+ private boolean anonymousAccess;
/**
* Creates a builder instance that is able to configure and construct {@link BlobServiceClient BlobServiceClients}
@@ -113,7 +114,44 @@ public BlobServiceClientBuilder() {
* and {@link #retryOptions(RequestRetryOptions)} have been set.
*/
public BlobServiceClient buildClient() {
- return new BlobServiceClient(buildAsyncClient());
+ BuilderHelper.httpsValidation(customerProvidedKey, "customer provided key", endpoint, LOGGER);
+
+ anonymousAccess = false;
+
+ if (Objects.nonNull(customerProvidedKey) && Objects.nonNull(encryptionScope)) {
+ throw LOGGER.logExceptionAsError(new IllegalArgumentException("Customer provided key and encryption "
+ + "scope cannot both be set"));
+ }
+
+ BlobServiceVersion serviceVersion = version != null ? version : BlobServiceVersion.getLatest();
+ HttpPipeline pipeline = constructPipeline();
+
+ boolean foundCredential = false;
+ for (int i = 0; i < pipeline.getPolicyCount(); i++) {
+ if (pipeline.getPolicy(i) instanceof StorageSharedKeyCredentialPolicy) {
+ foundCredential = true;
+ break;
+ }
+ if (pipeline.getPolicy(i) instanceof BearerTokenAuthenticationPolicy) {
+ foundCredential = true;
+ break;
+ }
+ if (pipeline.getPolicy(i) instanceof AzureSasCredentialPolicy) {
+ foundCredential = true;
+ break;
+ }
+ }
+ anonymousAccess = !foundCredential;
+
+ return new BlobServiceClient(pipeline, endpoint, serviceVersion, accountName, customerProvidedKey,
+ encryptionScope, blobContainerEncryptionScope, anonymousAccess);
+ }
+
+ private HttpPipeline constructPipeline() {
+ return (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline(
+ storageSharedKeyCredential, tokenCredential, azureSasCredential, sasToken,
+ endpoint, retryOptions, coreRetryOptions, logOptions,
+ clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, audience, LOGGER);
}
/**
@@ -126,7 +164,7 @@ public BlobServiceClient buildClient() {
public BlobServiceAsyncClient buildAsyncClient() {
BuilderHelper.httpsValidation(customerProvidedKey, "customer provided key", endpoint, LOGGER);
- boolean anonymousAccess = false;
+ anonymousAccess = false;
if (Objects.nonNull(customerProvidedKey) && Objects.nonNull(encryptionScope)) {
throw LOGGER.logExceptionAsError(new IllegalArgumentException("Customer provided key and encryption "
@@ -134,10 +172,7 @@ public BlobServiceAsyncClient buildAsyncClient() {
}
BlobServiceVersion serviceVersion = version != null ? version : BlobServiceVersion.getLatest();
- HttpPipeline pipeline = (httpPipeline != null) ? httpPipeline : BuilderHelper.buildPipeline(
- storageSharedKeyCredential, tokenCredential, azureSasCredential, sasToken,
- endpoint, retryOptions, coreRetryOptions, logOptions,
- clientOptions, httpClient, perCallPolicies, perRetryPolicies, configuration, audience, LOGGER);
+ HttpPipeline pipeline = constructPipeline();
boolean foundCredential = false;
for (int i = 0; i < pipeline.getPolicyCount(); i++) {
diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java
index 70bcd8fc25ce2..eefcbfced4a74 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/AppendBlobsImpl.java
@@ -128,6 +128,60 @@ Mono> createNoCustomHeaders(@HostParam("url") String url,
@HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode,
@HeaderParam("x-ms-legal-hold") Boolean legalHold, @HeaderParam("Accept") String accept, Context context);
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 201 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase createSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @HeaderParam("x-ms-blob-type") String blobType, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("Content-Length") long contentLength,
+ @HeaderParam("x-ms-blob-content-type") String contentType,
+ @HeaderParam("x-ms-blob-content-encoding") String contentEncoding,
+ @HeaderParam("x-ms-blob-content-language") String contentLanguage,
+ @HeaderParam("x-ms-blob-content-md5") String contentMd5,
+ @HeaderParam("x-ms-blob-cache-control") String cacheControl,
+ @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-blob-content-disposition") String contentDisposition,
+ @HeaderParam("x-ms-encryption-key") String encryptionKey,
+ @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256,
+ @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm,
+ @HeaderParam("x-ms-encryption-scope") String encryptionScope,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString,
+ @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry,
+ @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode,
+ @HeaderParam("x-ms-legal-hold") Boolean legalHold, @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 201 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response createNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @HeaderParam("x-ms-blob-type") String blobType, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("Content-Length") long contentLength,
+ @HeaderParam("x-ms-blob-content-type") String contentType,
+ @HeaderParam("x-ms-blob-content-encoding") String contentEncoding,
+ @HeaderParam("x-ms-blob-content-language") String contentLanguage,
+ @HeaderParam("x-ms-blob-content-md5") String contentMd5,
+ @HeaderParam("x-ms-blob-cache-control") String cacheControl,
+ @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-blob-content-disposition") String contentDisposition,
+ @HeaderParam("x-ms-encryption-key") String encryptionKey,
+ @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256,
+ @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm,
+ @HeaderParam("x-ms-encryption-scope") String encryptionScope,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString,
+ @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry,
+ @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode,
+ @HeaderParam("x-ms-legal-hold") Boolean legalHold, @HeaderParam("Accept") String accept, Context context);
+
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 201 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -220,6 +274,52 @@ Mono> appendBlockNoCustomHeaders(@HostParam("url") String url,
@BodyParam("application/octet-stream") BinaryData body, @HeaderParam("Accept") String accept,
Context context);
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 201 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase appendBlockSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("Content-Length") long contentLength,
+ @HeaderParam("Content-MD5") String transactionalContentMD5,
+ @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64,
+ @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-condition-maxsize") Long maxSize,
+ @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition,
+ @HeaderParam("x-ms-encryption-key") String encryptionKey,
+ @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256,
+ @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm,
+ @HeaderParam("x-ms-encryption-scope") String encryptionScope,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId,
+ @BodyParam("application/octet-stream") BinaryData body, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 201 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response appendBlockNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("Content-Length") long contentLength,
+ @HeaderParam("Content-MD5") String transactionalContentMD5,
+ @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64,
+ @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-blob-condition-maxsize") Long maxSize,
+ @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition,
+ @HeaderParam("x-ms-encryption-key") String encryptionKey,
+ @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256,
+ @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm,
+ @HeaderParam("x-ms-encryption-scope") String encryptionScope,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId,
+ @BodyParam("application/octet-stream") BinaryData body, @HeaderParam("Accept") String accept,
+ Context context);
+
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 201 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -278,6 +378,64 @@ Mono> appendBlockFromUrlNoCustomHeaders(@HostParam("url") String
@HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization,
@HeaderParam("Accept") String accept, Context context);
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 201 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase appendBlockFromUrlSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-copy-source") String sourceUrl,
+ @HeaderParam("x-ms-source-range") String sourceRange,
+ @HeaderParam("x-ms-source-content-md5") String sourceContentMD5,
+ @HeaderParam("x-ms-source-content-crc64") String sourceContentcrc64, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("Content-Length") long contentLength,
+ @HeaderParam("Content-MD5") String transactionalContentMD5,
+ @HeaderParam("x-ms-encryption-key") String encryptionKey,
+ @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256,
+ @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm,
+ @HeaderParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-blob-condition-maxsize") Long maxSize,
+ @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags,
+ @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince,
+ @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince,
+ @HeaderParam("x-ms-source-if-match") String sourceIfMatch,
+ @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 201 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response appendBlockFromUrlNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-copy-source") String sourceUrl,
+ @HeaderParam("x-ms-source-range") String sourceRange,
+ @HeaderParam("x-ms-source-content-md5") String sourceContentMD5,
+ @HeaderParam("x-ms-source-content-crc64") String sourceContentcrc64, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("Content-Length") long contentLength,
+ @HeaderParam("Content-MD5") String transactionalContentMD5,
+ @HeaderParam("x-ms-encryption-key") String encryptionKey,
+ @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256,
+ @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm,
+ @HeaderParam("x-ms-encryption-scope") String encryptionScope, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-blob-condition-maxsize") Long maxSize,
+ @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags,
+ @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince,
+ @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince,
+ @HeaderParam("x-ms-source-if-match") String sourceIfMatch,
+ @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization,
+ @HeaderParam("Accept") String accept, Context context);
+
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -305,6 +463,34 @@ Mono> sealNoCustomHeaders(@HostParam("url") String url,
@HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
@HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, @HeaderParam("Accept") String accept,
Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase sealSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response sealNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-blob-condition-appendpos") Long appendPosition, @HeaderParam("Accept") String accept,
+ Context context);
}
/**
@@ -861,28 +1047,21 @@ public Mono> createNoCustomHeadersWithResponseAsync(String contai
}
/**
- * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block
- * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is
- * supported only on version 2015-02-21 version or later.
+ * The Create Append Blob operation creates a new append blob.
*
* @param containerName The container name.
* @param blob The blob name.
* @param contentLength The length of the request.
- * @param body Initial data.
* @param timeout The timeout parameter is expressed in seconds. For more information, see <a
* href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
* Timeouts for Blob Service Operations.</a>.
- * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service.
- * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service.
+ * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value
+ * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob.
+ * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and
+ * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names
+ * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata
+ * for more information.
* @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
- * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append
- * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value
- * specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 -
- * Precondition Failed).
- * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating
- * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it
- * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition
- * Failed).
* @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the
* specified date/time.
* @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since
@@ -892,21 +1071,58 @@ public Mono> createNoCustomHeadersWithResponseAsync(String contai
* @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value.
* @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
* analytics logs when storage analytics logging is enabled.
+ * @param blobTagsString Optional. Used to set blob tags in various blob operations.
+ * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire.
+ * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob.
+ * @param legalHold Specified if a legal hold should be set on the blob.
+ * @param blobHttpHeaders Parameter group.
* @param cpkInfo Parameter group.
* @param encryptionScopeParam Parameter group.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the {@link ResponseBase} on successful completion of {@link Mono}.
+ * @return the {@link ResponseBase}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> appendBlockWithResponseAsync(String containerName,
- String blob, long contentLength, Flux body, Integer timeout, byte[] transactionalContentMD5,
- byte[] transactionalContentCrc64, String leaseId, Long maxSize, Long appendPosition,
+ public ResponseBase createWithResponse(String containerName, String blob,
+ long contentLength, Integer timeout, Map metadata, String leaseId,
OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch,
- String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) {
- final String comp = "appendblock";
+ String ifTags, String requestId, String blobTagsString, OffsetDateTime immutabilityPolicyExpiry,
+ BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, BlobHttpHeaders blobHttpHeaders,
+ CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) {
+ final String blobType = "AppendBlob";
final String accept = "application/xml";
+ String contentTypeInternal = null;
+ if (blobHttpHeaders != null) {
+ contentTypeInternal = blobHttpHeaders.getContentType();
+ }
+ String contentType = contentTypeInternal;
+ String contentEncodingInternal = null;
+ if (blobHttpHeaders != null) {
+ contentEncodingInternal = blobHttpHeaders.getContentEncoding();
+ }
+ String contentEncoding = contentEncodingInternal;
+ String contentLanguageInternal = null;
+ if (blobHttpHeaders != null) {
+ contentLanguageInternal = blobHttpHeaders.getContentLanguage();
+ }
+ String contentLanguage = contentLanguageInternal;
+ byte[] contentMd5Internal = null;
+ if (blobHttpHeaders != null) {
+ contentMd5Internal = blobHttpHeaders.getContentMd5();
+ }
+ byte[] contentMd5 = contentMd5Internal;
+ String cacheControlInternal = null;
+ if (blobHttpHeaders != null) {
+ cacheControlInternal = blobHttpHeaders.getCacheControl();
+ }
+ String cacheControl = cacheControlInternal;
+ String contentDispositionInternal = null;
+ if (blobHttpHeaders != null) {
+ contentDispositionInternal = blobHttpHeaders.getContentDisposition();
+ }
+ String contentDisposition = contentDispositionInternal;
String encryptionKeyInternal = null;
if (cpkInfo != null) {
encryptionKeyInternal = cpkInfo.getEncryptionKey();
@@ -927,19 +1143,268 @@ public Mono> appendBlockWithRe
encryptionScopeInternal = encryptionScopeParam.getEncryptionScope();
}
String encryptionScope = encryptionScopeInternal;
- String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5);
- String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64);
+ String contentMd5Converted = Base64Util.encodeToString(contentMd5);
DateTimeRfc1123 ifModifiedSinceConverted
= ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
DateTimeRfc1123 ifUnmodifiedSinceConverted
= ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
- return FluxUtil
- .withContext(context -> service.appendBlock(this.client.getUrl(), containerName, blob, comp, timeout,
- contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize,
- appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope,
- ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags,
- this.client.getVersion(), requestId, body, accept, context))
- .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException);
+ DateTimeRfc1123 immutabilityPolicyExpiryConverted
+ = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry);
+ try {
+ return service.createSync(this.client.getUrl(), containerName, blob, blobType, timeout, contentLength,
+ contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl, metadata, leaseId,
+ contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope,
+ ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags,
+ this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted,
+ immutabilityPolicyMode, legalHold, accept, context);
+ } catch (BlobStorageExceptionInternal internalException) {
+ throw ModelHelper.mapToBlobStorageException(internalException);
+ }
+ }
+
+ /**
+ * The Create Append Blob operation creates a new append blob.
+ *
+ * @param containerName The container name.
+ * @param blob The blob name.
+ * @param contentLength The length of the request.
+ * @param timeout The timeout parameter is expressed in seconds. For more information, see <a
+ * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
+ * Timeouts for Blob Service Operations.</a>.
+ * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value
+ * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob.
+ * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and
+ * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names
+ * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata
+ * for more information.
+ * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
+ * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the
+ * specified date/time.
+ * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since
+ * the specified date/time.
+ * @param ifMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value.
+ * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
+ * analytics logs when storage analytics logging is enabled.
+ * @param blobTagsString Optional. Used to set blob tags in various blob operations.
+ * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire.
+ * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob.
+ * @param legalHold Specified if a legal hold should be set on the blob.
+ * @param blobHttpHeaders Parameter group.
+ * @param cpkInfo Parameter group.
+ * @param encryptionScopeParam Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void create(String containerName, String blob, long contentLength, Integer timeout,
+ Map metadata, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince,
+ String ifMatch, String ifNoneMatch, String ifTags, String requestId, String blobTagsString,
+ OffsetDateTime immutabilityPolicyExpiry, BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold,
+ BlobHttpHeaders blobHttpHeaders, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) {
+ createWithResponse(containerName, blob, contentLength, timeout, metadata, leaseId, ifModifiedSince,
+ ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, requestId, blobTagsString, immutabilityPolicyExpiry,
+ immutabilityPolicyMode, legalHold, blobHttpHeaders, cpkInfo, encryptionScopeParam, Context.NONE);
+ }
+
+ /**
+ * The Create Append Blob operation creates a new append blob.
+ *
+ * @param containerName The container name.
+ * @param blob The blob name.
+ * @param contentLength The length of the request.
+ * @param timeout The timeout parameter is expressed in seconds. For more information, see <a
+ * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
+ * Timeouts for Blob Service Operations.</a>.
+ * @param metadata Optional. Specifies a user-defined name-value pair associated with the blob. If no name-value
+ * pairs are specified, the operation will copy the metadata from the source blob or file to the destination blob.
+ * If one or more name-value pairs are specified, the destination blob is created with the specified metadata, and
+ * metadata is not copied from the source blob or file. Note that beginning with version 2009-09-19, metadata names
+ * must adhere to the naming rules for C# identifiers. See Naming and Referencing Containers, Blobs, and Metadata
+ * for more information.
+ * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
+ * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the
+ * specified date/time.
+ * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since
+ * the specified date/time.
+ * @param ifMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value.
+ * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
+ * analytics logs when storage analytics logging is enabled.
+ * @param blobTagsString Optional. Used to set blob tags in various blob operations.
+ * @param immutabilityPolicyExpiry Specifies the date time when the blobs immutability policy is set to expire.
+ * @param immutabilityPolicyMode Specifies the immutability policy mode to set on the blob.
+ * @param legalHold Specified if a legal hold should be set on the blob.
+ * @param blobHttpHeaders Parameter group.
+ * @param cpkInfo Parameter group.
+ * @param encryptionScopeParam Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response createNoCustomHeadersWithResponse(String containerName, String blob, long contentLength,
+ Integer timeout, Map metadata, String leaseId, OffsetDateTime ifModifiedSince,
+ OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId,
+ String blobTagsString, OffsetDateTime immutabilityPolicyExpiry,
+ BlobImmutabilityPolicyMode immutabilityPolicyMode, Boolean legalHold, BlobHttpHeaders blobHttpHeaders,
+ CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) {
+ final String blobType = "AppendBlob";
+ final String accept = "application/xml";
+ String contentTypeInternal = null;
+ if (blobHttpHeaders != null) {
+ contentTypeInternal = blobHttpHeaders.getContentType();
+ }
+ String contentType = contentTypeInternal;
+ String contentEncodingInternal = null;
+ if (blobHttpHeaders != null) {
+ contentEncodingInternal = blobHttpHeaders.getContentEncoding();
+ }
+ String contentEncoding = contentEncodingInternal;
+ String contentLanguageInternal = null;
+ if (blobHttpHeaders != null) {
+ contentLanguageInternal = blobHttpHeaders.getContentLanguage();
+ }
+ String contentLanguage = contentLanguageInternal;
+ byte[] contentMd5Internal = null;
+ if (blobHttpHeaders != null) {
+ contentMd5Internal = blobHttpHeaders.getContentMd5();
+ }
+ byte[] contentMd5 = contentMd5Internal;
+ String cacheControlInternal = null;
+ if (blobHttpHeaders != null) {
+ cacheControlInternal = blobHttpHeaders.getCacheControl();
+ }
+ String cacheControl = cacheControlInternal;
+ String contentDispositionInternal = null;
+ if (blobHttpHeaders != null) {
+ contentDispositionInternal = blobHttpHeaders.getContentDisposition();
+ }
+ String contentDisposition = contentDispositionInternal;
+ String encryptionKeyInternal = null;
+ if (cpkInfo != null) {
+ encryptionKeyInternal = cpkInfo.getEncryptionKey();
+ }
+ String encryptionKey = encryptionKeyInternal;
+ String encryptionKeySha256Internal = null;
+ if (cpkInfo != null) {
+ encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256();
+ }
+ String encryptionKeySha256 = encryptionKeySha256Internal;
+ EncryptionAlgorithmType encryptionAlgorithmInternal = null;
+ if (cpkInfo != null) {
+ encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm();
+ }
+ EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal;
+ String encryptionScopeInternal = null;
+ if (encryptionScopeParam != null) {
+ encryptionScopeInternal = encryptionScopeParam.getEncryptionScope();
+ }
+ String encryptionScope = encryptionScopeInternal;
+ String contentMd5Converted = Base64Util.encodeToString(contentMd5);
+ DateTimeRfc1123 ifModifiedSinceConverted
+ = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
+ DateTimeRfc1123 ifUnmodifiedSinceConverted
+ = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
+ DateTimeRfc1123 immutabilityPolicyExpiryConverted
+ = immutabilityPolicyExpiry == null ? null : new DateTimeRfc1123(immutabilityPolicyExpiry);
+ try {
+ return service.createNoCustomHeadersSync(this.client.getUrl(), containerName, blob, blobType, timeout,
+ contentLength, contentType, contentEncoding, contentLanguage, contentMd5Converted, cacheControl,
+ metadata, leaseId, contentDisposition, encryptionKey, encryptionKeySha256, encryptionAlgorithm,
+ encryptionScope, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags,
+ this.client.getVersion(), requestId, blobTagsString, immutabilityPolicyExpiryConverted,
+ immutabilityPolicyMode, legalHold, accept, context);
+ } catch (BlobStorageExceptionInternal internalException) {
+ throw ModelHelper.mapToBlobStorageException(internalException);
+ }
+ }
+
+ /**
+ * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block
+ * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is
+ * supported only on version 2015-02-21 version or later.
+ *
+ * @param containerName The container name.
+ * @param blob The blob name.
+ * @param contentLength The length of the request.
+ * @param body Initial data.
+ * @param timeout The timeout parameter is expressed in seconds. For more information, see <a
+ * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
+ * Timeouts for Blob Service Operations.</a>.
+ * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service.
+ * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service.
+ * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
+ * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append
+ * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value
+ * specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 -
+ * Precondition Failed).
+ * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating
+ * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it
+ * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition
+ * Failed).
+ * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the
+ * specified date/time.
+ * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since
+ * the specified date/time.
+ * @param ifMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value.
+ * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
+ * analytics logs when storage analytics logging is enabled.
+ * @param cpkInfo Parameter group.
+ * @param encryptionScopeParam Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link ResponseBase} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> appendBlockWithResponseAsync(String containerName,
+ String blob, long contentLength, Flux body, Integer timeout, byte[] transactionalContentMD5,
+ byte[] transactionalContentCrc64, String leaseId, Long maxSize, Long appendPosition,
+ OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch,
+ String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) {
+ final String comp = "appendblock";
+ final String accept = "application/xml";
+ String encryptionKeyInternal = null;
+ if (cpkInfo != null) {
+ encryptionKeyInternal = cpkInfo.getEncryptionKey();
+ }
+ String encryptionKey = encryptionKeyInternal;
+ String encryptionKeySha256Internal = null;
+ if (cpkInfo != null) {
+ encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256();
+ }
+ String encryptionKeySha256 = encryptionKeySha256Internal;
+ EncryptionAlgorithmType encryptionAlgorithmInternal = null;
+ if (cpkInfo != null) {
+ encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm();
+ }
+ EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal;
+ String encryptionScopeInternal = null;
+ if (encryptionScopeParam != null) {
+ encryptionScopeInternal = encryptionScopeParam.getEncryptionScope();
+ }
+ String encryptionScope = encryptionScopeInternal;
+ String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5);
+ String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64);
+ DateTimeRfc1123 ifModifiedSinceConverted
+ = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
+ DateTimeRfc1123 ifUnmodifiedSinceConverted
+ = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
+ return FluxUtil
+ .withContext(context -> service.appendBlock(this.client.getUrl(), containerName, blob, comp, timeout,
+ contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize,
+ appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope,
+ ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags,
+ this.client.getVersion(), requestId, body, accept, context))
+ .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException);
}
/**
@@ -1729,22 +2194,19 @@ public Mono> appendBlockNoCustomHeadersWithResponseAsync(String c
}
/**
- * The Append Block operation commits a new block of data to the end of an existing append blob where the contents
- * are read from a source url. The Append Block operation is permitted only if the blob was created with
- * x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later.
+ * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block
+ * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is
+ * supported only on version 2015-02-21 version or later.
*
* @param containerName The container name.
* @param blob The blob name.
- * @param sourceUrl Specify a URL to the copy source.
* @param contentLength The length of the request.
- * @param sourceRange Bytes of source data in the specified range.
- * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source.
- * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy
- * source.
+ * @param body Initial data.
* @param timeout The timeout parameter is expressed in seconds. For more information, see <a
* href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
* Timeouts for Blob Service Operations.</a>.
* @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service.
+ * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service.
* @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
* @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append
* Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value
@@ -1761,10 +2223,231 @@ public Mono> appendBlockNoCustomHeadersWithResponseAsync(String c
* @param ifMatch Specify an ETag value to operate only on blobs with a matching value.
* @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
* @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value.
- * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since
- * the specified date/time.
- * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified
- * since the specified date/time.
+ * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
+ * analytics logs when storage analytics logging is enabled.
+ * @param cpkInfo Parameter group.
+ * @param encryptionScopeParam Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link ResponseBase}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ResponseBase appendBlockWithResponse(String containerName, String blob,
+ long contentLength, BinaryData body, Integer timeout, byte[] transactionalContentMD5,
+ byte[] transactionalContentCrc64, String leaseId, Long maxSize, Long appendPosition,
+ OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch,
+ String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) {
+ final String comp = "appendblock";
+ final String accept = "application/xml";
+ String encryptionKeyInternal = null;
+ if (cpkInfo != null) {
+ encryptionKeyInternal = cpkInfo.getEncryptionKey();
+ }
+ String encryptionKey = encryptionKeyInternal;
+ String encryptionKeySha256Internal = null;
+ if (cpkInfo != null) {
+ encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256();
+ }
+ String encryptionKeySha256 = encryptionKeySha256Internal;
+ EncryptionAlgorithmType encryptionAlgorithmInternal = null;
+ if (cpkInfo != null) {
+ encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm();
+ }
+ EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal;
+ String encryptionScopeInternal = null;
+ if (encryptionScopeParam != null) {
+ encryptionScopeInternal = encryptionScopeParam.getEncryptionScope();
+ }
+ String encryptionScope = encryptionScopeInternal;
+ String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5);
+ String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64);
+ DateTimeRfc1123 ifModifiedSinceConverted
+ = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
+ DateTimeRfc1123 ifUnmodifiedSinceConverted
+ = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
+ try {
+ return service.appendBlockSync(this.client.getUrl(), containerName, blob, comp, timeout, contentLength,
+ transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize, appendPosition,
+ encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope, ifModifiedSinceConverted,
+ ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, this.client.getVersion(), requestId, body,
+ accept, context);
+ } catch (BlobStorageExceptionInternal internalException) {
+ throw ModelHelper.mapToBlobStorageException(internalException);
+ }
+ }
+
+ /**
+ * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block
+ * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is
+ * supported only on version 2015-02-21 version or later.
+ *
+ * @param containerName The container name.
+ * @param blob The blob name.
+ * @param contentLength The length of the request.
+ * @param body Initial data.
+ * @param timeout The timeout parameter is expressed in seconds. For more information, see <a
+ * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
+ * Timeouts for Blob Service Operations.</a>.
+ * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service.
+ * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service.
+ * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
+ * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append
+ * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value
+ * specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 -
+ * Precondition Failed).
+ * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating
+ * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it
+ * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition
+ * Failed).
+ * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the
+ * specified date/time.
+ * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since
+ * the specified date/time.
+ * @param ifMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value.
+ * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
+ * analytics logs when storage analytics logging is enabled.
+ * @param cpkInfo Parameter group.
+ * @param encryptionScopeParam Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void appendBlock(String containerName, String blob, long contentLength, BinaryData body, Integer timeout,
+ byte[] transactionalContentMD5, byte[] transactionalContentCrc64, String leaseId, Long maxSize,
+ Long appendPosition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch,
+ String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) {
+ appendBlockWithResponse(containerName, blob, contentLength, body, timeout, transactionalContentMD5,
+ transactionalContentCrc64, leaseId, maxSize, appendPosition, ifModifiedSince, ifUnmodifiedSince, ifMatch,
+ ifNoneMatch, ifTags, requestId, cpkInfo, encryptionScopeParam, Context.NONE);
+ }
+
+ /**
+ * The Append Block operation commits a new block of data to the end of an existing append blob. The Append Block
+ * operation is permitted only if the blob was created with x-ms-blob-type set to AppendBlob. Append Block is
+ * supported only on version 2015-02-21 version or later.
+ *
+ * @param containerName The container name.
+ * @param blob The blob name.
+ * @param contentLength The length of the request.
+ * @param body Initial data.
+ * @param timeout The timeout parameter is expressed in seconds. For more information, see <a
+ * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
+ * Timeouts for Blob Service Operations.</a>.
+ * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service.
+ * @param transactionalContentCrc64 Specify the transactional crc64 for the body, to be validated by the service.
+ * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
+ * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append
+ * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value
+ * specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 -
+ * Precondition Failed).
+ * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating
+ * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it
+ * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition
+ * Failed).
+ * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the
+ * specified date/time.
+ * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since
+ * the specified date/time.
+ * @param ifMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value.
+ * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
+ * analytics logs when storage analytics logging is enabled.
+ * @param cpkInfo Parameter group.
+ * @param encryptionScopeParam Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response appendBlockNoCustomHeadersWithResponse(String containerName, String blob, long contentLength,
+ BinaryData body, Integer timeout, byte[] transactionalContentMD5, byte[] transactionalContentCrc64,
+ String leaseId, Long maxSize, Long appendPosition, OffsetDateTime ifModifiedSince,
+ OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String requestId,
+ CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) {
+ final String comp = "appendblock";
+ final String accept = "application/xml";
+ String encryptionKeyInternal = null;
+ if (cpkInfo != null) {
+ encryptionKeyInternal = cpkInfo.getEncryptionKey();
+ }
+ String encryptionKey = encryptionKeyInternal;
+ String encryptionKeySha256Internal = null;
+ if (cpkInfo != null) {
+ encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256();
+ }
+ String encryptionKeySha256 = encryptionKeySha256Internal;
+ EncryptionAlgorithmType encryptionAlgorithmInternal = null;
+ if (cpkInfo != null) {
+ encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm();
+ }
+ EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal;
+ String encryptionScopeInternal = null;
+ if (encryptionScopeParam != null) {
+ encryptionScopeInternal = encryptionScopeParam.getEncryptionScope();
+ }
+ String encryptionScope = encryptionScopeInternal;
+ String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5);
+ String transactionalContentCrc64Converted = Base64Util.encodeToString(transactionalContentCrc64);
+ DateTimeRfc1123 ifModifiedSinceConverted
+ = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
+ DateTimeRfc1123 ifUnmodifiedSinceConverted
+ = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
+ try {
+ return service.appendBlockNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, timeout,
+ contentLength, transactionalContentMD5Converted, transactionalContentCrc64Converted, leaseId, maxSize,
+ appendPosition, encryptionKey, encryptionKeySha256, encryptionAlgorithm, encryptionScope,
+ ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags,
+ this.client.getVersion(), requestId, body, accept, context);
+ } catch (BlobStorageExceptionInternal internalException) {
+ throw ModelHelper.mapToBlobStorageException(internalException);
+ }
+ }
+
+ /**
+ * The Append Block operation commits a new block of data to the end of an existing append blob where the contents
+ * are read from a source url. The Append Block operation is permitted only if the blob was created with
+ * x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later.
+ *
+ * @param containerName The container name.
+ * @param blob The blob name.
+ * @param sourceUrl Specify a URL to the copy source.
+ * @param contentLength The length of the request.
+ * @param sourceRange Bytes of source data in the specified range.
+ * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source.
+ * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy
+ * source.
+ * @param timeout The timeout parameter is expressed in seconds. For more information, see <a
+ * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
+ * Timeouts for Blob Service Operations.</a>.
+ * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service.
+ * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
+ * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append
+ * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value
+ * specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 -
+ * Precondition Failed).
+ * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating
+ * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it
+ * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition
+ * Failed).
+ * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the
+ * specified date/time.
+ * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since
+ * the specified date/time.
+ * @param ifMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value.
+ * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since
+ * the specified date/time.
+ * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified
+ * since the specified date/time.
* @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value.
* @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value.
* @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
@@ -2269,40 +2952,314 @@ public Mono> appendBlockFromUrlNoCustomHeadersWithResponseAsync(S
}
/**
- * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12
- * version or later.
+ * The Append Block operation commits a new block of data to the end of an existing append blob where the contents
+ * are read from a source url. The Append Block operation is permitted only if the blob was created with
+ * x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later.
*
* @param containerName The container name.
* @param blob The blob name.
+ * @param sourceUrl Specify a URL to the copy source.
+ * @param contentLength The length of the request.
+ * @param sourceRange Bytes of source data in the specified range.
+ * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source.
+ * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy
+ * source.
* @param timeout The timeout parameter is expressed in seconds. For more information, see <a
* href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
* Timeouts for Blob Service Operations.</a>.
- * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
- * analytics logs when storage analytics logging is enabled.
+ * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service.
* @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
+ * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append
+ * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value
+ * specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 -
+ * Precondition Failed).
+ * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating
+ * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it
+ * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition
+ * Failed).
* @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the
* specified date/time.
* @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since
* the specified date/time.
* @param ifMatch Specify an ETag value to operate only on blobs with a matching value.
* @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
- * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating
- * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it
- * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition
- * Failed).
+ * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value.
+ * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since
+ * the specified date/time.
+ * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified
+ * since the specified date/time.
+ * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
+ * analytics logs when storage analytics logging is enabled.
+ * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to
+ * copy source.
+ * @param cpkInfo Parameter group.
+ * @param encryptionScopeParam Parameter group.
+ * @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the {@link ResponseBase} on successful completion of {@link Mono}.
+ * @return the {@link ResponseBase}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Mono> sealWithResponseAsync(String containerName, String blob,
- Integer timeout, String requestId, String leaseId, OffsetDateTime ifModifiedSince,
- OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, Long appendPosition) {
- final String comp = "seal";
+ public ResponseBase appendBlockFromUrlWithResponse(String containerName,
+ String blob, String sourceUrl, long contentLength, String sourceRange, byte[] sourceContentMD5,
+ byte[] sourceContentcrc64, Integer timeout, byte[] transactionalContentMD5, String leaseId, Long maxSize,
+ Long appendPosition, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch,
+ String ifNoneMatch, String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince,
+ String sourceIfMatch, String sourceIfNoneMatch, String requestId, String copySourceAuthorization,
+ CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) {
+ final String comp = "appendblock";
final String accept = "application/xml";
- DateTimeRfc1123 ifModifiedSinceConverted
- = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
+ String encryptionKeyInternal = null;
+ if (cpkInfo != null) {
+ encryptionKeyInternal = cpkInfo.getEncryptionKey();
+ }
+ String encryptionKey = encryptionKeyInternal;
+ String encryptionKeySha256Internal = null;
+ if (cpkInfo != null) {
+ encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256();
+ }
+ String encryptionKeySha256 = encryptionKeySha256Internal;
+ EncryptionAlgorithmType encryptionAlgorithmInternal = null;
+ if (cpkInfo != null) {
+ encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm();
+ }
+ EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal;
+ String encryptionScopeInternal = null;
+ if (encryptionScopeParam != null) {
+ encryptionScopeInternal = encryptionScopeParam.getEncryptionScope();
+ }
+ String encryptionScope = encryptionScopeInternal;
+ String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5);
+ String sourceContentcrc64Converted = Base64Util.encodeToString(sourceContentcrc64);
+ String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5);
+ DateTimeRfc1123 ifModifiedSinceConverted
+ = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
+ DateTimeRfc1123 ifUnmodifiedSinceConverted
+ = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
+ DateTimeRfc1123 sourceIfModifiedSinceConverted
+ = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince);
+ DateTimeRfc1123 sourceIfUnmodifiedSinceConverted
+ = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince);
+ try {
+ return service.appendBlockFromUrlSync(this.client.getUrl(), containerName, blob, comp, sourceUrl,
+ sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, contentLength,
+ transactionalContentMD5Converted, encryptionKey, encryptionKeySha256, encryptionAlgorithm,
+ encryptionScope, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted,
+ ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted,
+ sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, copySourceAuthorization, accept,
+ context);
+ } catch (BlobStorageExceptionInternal internalException) {
+ throw ModelHelper.mapToBlobStorageException(internalException);
+ }
+ }
+
+ /**
+ * The Append Block operation commits a new block of data to the end of an existing append blob where the contents
+ * are read from a source url. The Append Block operation is permitted only if the blob was created with
+ * x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later.
+ *
+ * @param containerName The container name.
+ * @param blob The blob name.
+ * @param sourceUrl Specify a URL to the copy source.
+ * @param contentLength The length of the request.
+ * @param sourceRange Bytes of source data in the specified range.
+ * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source.
+ * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy
+ * source.
+ * @param timeout The timeout parameter is expressed in seconds. For more information, see <a
+ * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
+ * Timeouts for Blob Service Operations.</a>.
+ * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service.
+ * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
+ * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append
+ * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value
+ * specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 -
+ * Precondition Failed).
+ * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating
+ * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it
+ * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition
+ * Failed).
+ * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the
+ * specified date/time.
+ * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since
+ * the specified date/time.
+ * @param ifMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value.
+ * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since
+ * the specified date/time.
+ * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified
+ * since the specified date/time.
+ * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
+ * analytics logs when storage analytics logging is enabled.
+ * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to
+ * copy source.
+ * @param cpkInfo Parameter group.
+ * @param encryptionScopeParam Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void appendBlockFromUrl(String containerName, String blob, String sourceUrl, long contentLength,
+ String sourceRange, byte[] sourceContentMD5, byte[] sourceContentcrc64, Integer timeout,
+ byte[] transactionalContentMD5, String leaseId, Long maxSize, Long appendPosition,
+ OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch,
+ String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince,
+ String sourceIfMatch, String sourceIfNoneMatch, String requestId, String copySourceAuthorization,
+ CpkInfo cpkInfo, EncryptionScope encryptionScopeParam) {
+ appendBlockFromUrlWithResponse(containerName, blob, sourceUrl, contentLength, sourceRange, sourceContentMD5,
+ sourceContentcrc64, timeout, transactionalContentMD5, leaseId, maxSize, appendPosition, ifModifiedSince,
+ ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSince, sourceIfUnmodifiedSince,
+ sourceIfMatch, sourceIfNoneMatch, requestId, copySourceAuthorization, cpkInfo, encryptionScopeParam,
+ Context.NONE);
+ }
+
+ /**
+ * The Append Block operation commits a new block of data to the end of an existing append blob where the contents
+ * are read from a source url. The Append Block operation is permitted only if the blob was created with
+ * x-ms-blob-type set to AppendBlob. Append Block is supported only on version 2015-02-21 version or later.
+ *
+ * @param containerName The container name.
+ * @param blob The blob name.
+ * @param sourceUrl Specify a URL to the copy source.
+ * @param contentLength The length of the request.
+ * @param sourceRange Bytes of source data in the specified range.
+ * @param sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source.
+ * @param sourceContentcrc64 Specify the crc64 calculated for the range of bytes that must be read from the copy
+ * source.
+ * @param timeout The timeout parameter is expressed in seconds. For more information, see <a
+ * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
+ * Timeouts for Blob Service Operations.</a>.
+ * @param transactionalContentMD5 Specify the transactional md5 for the body, to be validated by the service.
+ * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
+ * @param maxSize Optional conditional header. The max length in bytes permitted for the append blob. If the Append
+ * Block operation would cause the blob to exceed that limit or if the blob size is already greater than the value
+ * specified in this header, the request will fail with MaxBlobSizeConditionNotMet error (HTTP status code 412 -
+ * Precondition Failed).
+ * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating
+ * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it
+ * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition
+ * Failed).
+ * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the
+ * specified date/time.
+ * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since
+ * the specified date/time.
+ * @param ifMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value.
+ * @param sourceIfModifiedSince Specify this header value to operate only on a blob if it has been modified since
+ * the specified date/time.
+ * @param sourceIfUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified
+ * since the specified date/time.
+ * @param sourceIfMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param sourceIfNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
+ * analytics logs when storage analytics logging is enabled.
+ * @param copySourceAuthorization Only Bearer type is supported. Credentials should be a valid OAuth access token to
+ * copy source.
+ * @param cpkInfo Parameter group.
+ * @param encryptionScopeParam Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response appendBlockFromUrlNoCustomHeadersWithResponse(String containerName, String blob,
+ String sourceUrl, long contentLength, String sourceRange, byte[] sourceContentMD5, byte[] sourceContentcrc64,
+ Integer timeout, byte[] transactionalContentMD5, String leaseId, Long maxSize, Long appendPosition,
+ OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch,
+ String ifTags, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince,
+ String sourceIfMatch, String sourceIfNoneMatch, String requestId, String copySourceAuthorization,
+ CpkInfo cpkInfo, EncryptionScope encryptionScopeParam, Context context) {
+ final String comp = "appendblock";
+ final String accept = "application/xml";
+ String encryptionKeyInternal = null;
+ if (cpkInfo != null) {
+ encryptionKeyInternal = cpkInfo.getEncryptionKey();
+ }
+ String encryptionKey = encryptionKeyInternal;
+ String encryptionKeySha256Internal = null;
+ if (cpkInfo != null) {
+ encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256();
+ }
+ String encryptionKeySha256 = encryptionKeySha256Internal;
+ EncryptionAlgorithmType encryptionAlgorithmInternal = null;
+ if (cpkInfo != null) {
+ encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm();
+ }
+ EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal;
+ String encryptionScopeInternal = null;
+ if (encryptionScopeParam != null) {
+ encryptionScopeInternal = encryptionScopeParam.getEncryptionScope();
+ }
+ String encryptionScope = encryptionScopeInternal;
+ String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5);
+ String sourceContentcrc64Converted = Base64Util.encodeToString(sourceContentcrc64);
+ String transactionalContentMD5Converted = Base64Util.encodeToString(transactionalContentMD5);
+ DateTimeRfc1123 ifModifiedSinceConverted
+ = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
+ DateTimeRfc1123 ifUnmodifiedSinceConverted
+ = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
+ DateTimeRfc1123 sourceIfModifiedSinceConverted
+ = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince);
+ DateTimeRfc1123 sourceIfUnmodifiedSinceConverted
+ = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince);
+ try {
+ return service.appendBlockFromUrlNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp,
+ sourceUrl, sourceRange, sourceContentMD5Converted, sourceContentcrc64Converted, timeout, contentLength,
+ transactionalContentMD5Converted, encryptionKey, encryptionKeySha256, encryptionAlgorithm,
+ encryptionScope, leaseId, maxSize, appendPosition, ifModifiedSinceConverted, ifUnmodifiedSinceConverted,
+ ifMatch, ifNoneMatch, ifTags, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted,
+ sourceIfMatch, sourceIfNoneMatch, this.client.getVersion(), requestId, copySourceAuthorization, accept,
+ context);
+ } catch (BlobStorageExceptionInternal internalException) {
+ throw ModelHelper.mapToBlobStorageException(internalException);
+ }
+ }
+
+ /**
+ * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12
+ * version or later.
+ *
+ * @param containerName The container name.
+ * @param blob The blob name.
+ * @param timeout The timeout parameter is expressed in seconds. For more information, see <a
+ * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
+ * Timeouts for Blob Service Operations.</a>.
+ * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
+ * analytics logs when storage analytics logging is enabled.
+ * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
+ * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the
+ * specified date/time.
+ * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since
+ * the specified date/time.
+ * @param ifMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating
+ * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it
+ * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition
+ * Failed).
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link ResponseBase} on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono> sealWithResponseAsync(String containerName, String blob,
+ Integer timeout, String requestId, String leaseId, OffsetDateTime ifModifiedSince,
+ OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, Long appendPosition) {
+ final String comp = "seal";
+ final String accept = "application/xml";
+ DateTimeRfc1123 ifModifiedSinceConverted
+ = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
DateTimeRfc1123 ifUnmodifiedSinceConverted
= ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
return FluxUtil
@@ -2520,4 +3477,132 @@ public Mono> sealNoCustomHeadersWithResponseAsync(String containe
appendPosition, accept, context)
.onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException);
}
+
+ /**
+ * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12
+ * version or later.
+ *
+ * @param containerName The container name.
+ * @param blob The blob name.
+ * @param timeout The timeout parameter is expressed in seconds. For more information, see <a
+ * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
+ * Timeouts for Blob Service Operations.</a>.
+ * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
+ * analytics logs when storage analytics logging is enabled.
+ * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
+ * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the
+ * specified date/time.
+ * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since
+ * the specified date/time.
+ * @param ifMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating
+ * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it
+ * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition
+ * Failed).
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link ResponseBase}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public ResponseBase sealWithResponse(String containerName, String blob,
+ Integer timeout, String requestId, String leaseId, OffsetDateTime ifModifiedSince,
+ OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, Long appendPosition, Context context) {
+ final String comp = "seal";
+ final String accept = "application/xml";
+ DateTimeRfc1123 ifModifiedSinceConverted
+ = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
+ DateTimeRfc1123 ifUnmodifiedSinceConverted
+ = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
+ try {
+ return service.sealSync(this.client.getUrl(), containerName, blob, comp, timeout, this.client.getVersion(),
+ requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch,
+ appendPosition, accept, context);
+ } catch (BlobStorageExceptionInternal internalException) {
+ throw ModelHelper.mapToBlobStorageException(internalException);
+ }
+ }
+
+ /**
+ * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12
+ * version or later.
+ *
+ * @param containerName The container name.
+ * @param blob The blob name.
+ * @param timeout The timeout parameter is expressed in seconds. For more information, see <a
+ * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
+ * Timeouts for Blob Service Operations.</a>.
+ * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
+ * analytics logs when storage analytics logging is enabled.
+ * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
+ * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the
+ * specified date/time.
+ * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since
+ * the specified date/time.
+ * @param ifMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating
+ * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it
+ * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition
+ * Failed).
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public void seal(String containerName, String blob, Integer timeout, String requestId, String leaseId,
+ OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch,
+ Long appendPosition) {
+ sealWithResponse(containerName, blob, timeout, requestId, leaseId, ifModifiedSince, ifUnmodifiedSince, ifMatch,
+ ifNoneMatch, appendPosition, Context.NONE);
+ }
+
+ /**
+ * The Seal operation seals the Append Blob to make it read-only. Seal is supported only on version 2019-12-12
+ * version or later.
+ *
+ * @param containerName The container name.
+ * @param blob The blob name.
+ * @param timeout The timeout parameter is expressed in seconds. For more information, see <a
+ * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
+ * Timeouts for Blob Service Operations.</a>.
+ * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
+ * analytics logs when storage analytics logging is enabled.
+ * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
+ * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the
+ * specified date/time.
+ * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since
+ * the specified date/time.
+ * @param ifMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param appendPosition Optional conditional header, used only for the Append Block operation. A number indicating
+ * the byte offset to compare. Append Block will succeed only if the append position is equal to this number. If it
+ * is not, the request will fail with the AppendPositionConditionNotMet error (HTTP status code 412 - Precondition
+ * Failed).
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the {@link Response}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Response sealNoCustomHeadersWithResponse(String containerName, String blob, Integer timeout,
+ String requestId, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince,
+ String ifMatch, String ifNoneMatch, Long appendPosition, Context context) {
+ final String comp = "seal";
+ final String accept = "application/xml";
+ DateTimeRfc1123 ifModifiedSinceConverted
+ = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
+ DateTimeRfc1123 ifUnmodifiedSinceConverted
+ = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
+ try {
+ return service.sealNoCustomHeadersSync(this.client.getUrl(), containerName, blob, comp, timeout,
+ this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted,
+ ifMatch, ifNoneMatch, appendPosition, accept, context);
+ } catch (BlobStorageExceptionInternal internalException) {
+ throw ModelHelper.mapToBlobStorageException(internalException);
+ }
+ }
}
diff --git a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java
index c5770824b839e..7e9b7354bc7d3 100644
--- a/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java
+++ b/sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/implementation/BlobsImpl.java
@@ -65,6 +65,7 @@
import com.azure.storage.blob.models.DeleteSnapshotsOptionType;
import com.azure.storage.blob.models.EncryptionAlgorithmType;
import com.azure.storage.blob.models.RehydratePriority;
+import java.io.InputStream;
import java.nio.ByteBuffer;
import java.time.OffsetDateTime;
import java.util.Map;
@@ -145,6 +146,46 @@ Mono downloadNoCustomHeaders(@HostParam("url") String url,
@HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
Context context);
+ @Get("/{containerName}/{blob}")
+ @ExpectedResponses({ 200, 206 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase downloadSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range,
+ @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-range-get-content-md5") Boolean rangeGetContentMD5,
+ @HeaderParam("x-ms-range-get-content-crc64") Boolean rangeGetContentCRC64,
+ @HeaderParam("x-ms-encryption-key") String encryptionKey,
+ @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256,
+ @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Get("/{containerName}/{blob}")
+ @ExpectedResponses({ 200, 206 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response downloadNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-range") String range,
+ @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-range-get-content-md5") Boolean rangeGetContentMD5,
+ @HeaderParam("x-ms-range-get-content-crc64") Boolean rangeGetContentCRC64,
+ @HeaderParam("x-ms-encryption-key") String encryptionKey,
+ @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256,
+ @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
@Head("/{containerName}/{blob}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -179,6 +220,40 @@ Mono> getPropertiesNoCustomHeaders(@HostParam("url") String url,
@HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
Context context);
+ @Head("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase getPropertiesSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-encryption-key") String encryptionKey,
+ @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256,
+ @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Head("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response getPropertiesNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-encryption-key") String encryptionKey,
+ @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256,
+ @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
@Delete("/{containerName}/{blob}")
@ExpectedResponses({ 202 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -211,6 +286,38 @@ Mono> deleteNoCustomHeaders(@HostParam("url") String url,
@QueryParam("deletetype") BlobDeleteType blobDeleteType, @HeaderParam("Accept") String accept,
Context context);
+ @Delete("/{containerName}/{blob}")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase deleteSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-delete-snapshots") DeleteSnapshotsOptionType deleteSnapshots,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId,
+ @QueryParam("deletetype") BlobDeleteType blobDeleteType, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Delete("/{containerName}/{blob}")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response deleteNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-delete-snapshots") DeleteSnapshotsOptionType deleteSnapshots,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId,
+ @QueryParam("deletetype") BlobDeleteType blobDeleteType, @HeaderParam("Accept") String accept,
+ Context context);
+
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -229,6 +336,24 @@ Mono> undeleteNoCustomHeaders(@HostParam("url") String url,
@HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
@HeaderParam("Accept") String accept, Context context);
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase undeleteSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response undeleteNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("Accept") String accept, Context context);
+
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -249,6 +374,26 @@ Mono> setExpiryNoCustomHeaders(@HostParam("url") String url,
@HeaderParam("x-ms-expiry-option") BlobExpiryOptions expiryOptions,
@HeaderParam("x-ms-expiry-time") String expiresOn, @HeaderParam("Accept") String accept, Context context);
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase setExpirySync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("x-ms-expiry-option") BlobExpiryOptions expiryOptions,
+ @HeaderParam("x-ms-expiry-time") String expiresOn, @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response setExpiryNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("x-ms-expiry-option") BlobExpiryOptions expiryOptions,
+ @HeaderParam("x-ms-expiry-time") String expiresOn, @HeaderParam("Accept") String accept, Context context);
+
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -289,6 +434,46 @@ Mono> setHttpHeadersNoCustomHeaders(@HostParam("url") String url,
@HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
@HeaderParam("Accept") String accept, Context context);
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase setHttpHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-blob-cache-control") String cacheControl,
+ @HeaderParam("x-ms-blob-content-type") String contentType,
+ @HeaderParam("x-ms-blob-content-md5") String contentMd5,
+ @HeaderParam("x-ms-blob-content-encoding") String contentEncoding,
+ @HeaderParam("x-ms-blob-content-language") String contentLanguage,
+ @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags,
+ @HeaderParam("x-ms-blob-content-disposition") String contentDisposition,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response setHttpHeadersNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-blob-cache-control") String cacheControl,
+ @HeaderParam("x-ms-blob-content-type") String contentType,
+ @HeaderParam("x-ms-blob-content-md5") String contentMd5,
+ @HeaderParam("x-ms-blob-content-encoding") String contentEncoding,
+ @HeaderParam("x-ms-blob-content-language") String contentLanguage,
+ @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags,
+ @HeaderParam("x-ms-blob-content-disposition") String contentDisposition,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("Accept") String accept, Context context);
+
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -313,6 +498,30 @@ Mono> setImmutabilityPolicyNoCustomHeaders(@HostParam("url") Stri
@HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode,
@HeaderParam("Accept") String accept, Context context);
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase setImmutabilityPolicySync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry,
+ @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response setImmutabilityPolicyNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry,
+ @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode,
+ @HeaderParam("Accept") String accept, Context context);
+
@Delete("/{containerName}/{blob}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -331,6 +540,24 @@ Mono> deleteImmutabilityPolicyNoCustomHeaders(@HostParam("url") S
@HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
@HeaderParam("Accept") String accept, Context context);
+ @Delete("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase deleteImmutabilityPolicySync(
+ @HostParam("url") String url, @PathParam("containerName") String containerName,
+ @PathParam("blob") String blob, @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Delete("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response deleteImmutabilityPolicyNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("Accept") String accept, Context context);
+
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -349,6 +576,24 @@ Mono> setLegalHoldNoCustomHeaders(@HostParam("url") String url,
@HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
@HeaderParam("x-ms-legal-hold") boolean legalHold, @HeaderParam("Accept") String accept, Context context);
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase setLegalHoldSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("x-ms-legal-hold") boolean legalHold, @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response setLegalHoldNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("x-ms-legal-hold") boolean legalHold, @HeaderParam("Accept") String accept, Context context);
+
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -386,13 +631,16 @@ Mono> setMetadataNoCustomHeaders(@HostParam("url") String url,
Context context);
@Put("/{containerName}/{blob}")
- @ExpectedResponses({ 201 })
+ @ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
- Mono> acquireLease(@HostParam("url") String url,
+ ResponseBase setMetadataSync(@HostParam("url") String url,
@PathParam("containerName") String containerName, @PathParam("blob") String blob,
- @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action,
- @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration,
- @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-encryption-key") String encryptionKey,
+ @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256,
+ @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm,
+ @HeaderParam("x-ms-encryption-scope") String encryptionScope,
@HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
@HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
@HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
@@ -401,13 +649,16 @@ Mono> acquireLease(@HostParam("url"
Context context);
@Put("/{containerName}/{blob}")
- @ExpectedResponses({ 201 })
+ @ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
- Mono> acquireLeaseNoCustomHeaders(@HostParam("url") String url,
+ Response setMetadataNoCustomHeadersSync(@HostParam("url") String url,
@PathParam("containerName") String containerName, @PathParam("blob") String blob,
- @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action,
- @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration,
- @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-encryption-key") String encryptionKey,
+ @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256,
+ @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm,
+ @HeaderParam("x-ms-encryption-scope") String encryptionScope,
@HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
@HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
@HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
@@ -416,13 +667,73 @@ Mono> acquireLeaseNoCustomHeaders(@HostParam("url") String url,
Context context);
@Put("/{containerName}/{blob}")
- @ExpectedResponses({ 200 })
+ @ExpectedResponses({ 201 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
- Mono> releaseLease(@HostParam("url") String url,
+ Mono> acquireLease(@HostParam("url") String url,
@PathParam("containerName") String containerName, @PathParam("blob") String blob,
@QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action,
- @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId,
- @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration,
+ @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 201 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Mono> acquireLeaseNoCustomHeaders(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration,
+ @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 201 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase acquireLeaseSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration,
+ @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 201 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response acquireLeaseNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-duration") Integer duration,
+ @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Mono> releaseLease(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
@HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
@HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
@HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
@@ -443,6 +754,34 @@ Mono> releaseLeaseNoCustomHeaders(@HostParam("url") String url,
@HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
Context context);
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase releaseLeaseSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response releaseLeaseNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -471,6 +810,34 @@ Mono> renewLeaseNoCustomHeaders(@HostParam("url") String url,
@HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
Context context);
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase renewLeaseSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response renewLeaseNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -501,6 +868,36 @@ Mono> changeLeaseNoCustomHeaders(@HostParam("url") String url,
@HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
Context context);
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase changeLeaseSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response changeLeaseNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-proposed-lease-id") String proposedLeaseId,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 202 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -529,6 +926,34 @@ Mono> breakLeaseNoCustomHeaders(@HostParam("url") String url,
@HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
Context context);
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase breakLeaseSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response breakLeaseNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-lease-action") String action,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-break-period") Integer breakPeriod,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 201 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -565,6 +990,42 @@ Mono> createSnapshotNoCustomHeaders(@HostParam("url") String url,
@HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
@HeaderParam("Accept") String accept, Context context);
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 201 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase createSnapshotSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-meta-") Map metadata,
+ @HeaderParam("x-ms-encryption-key") String encryptionKey,
+ @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256,
+ @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm,
+ @HeaderParam("x-ms-encryption-scope") String encryptionScope,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 201 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response createSnapshotNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-meta-") Map metadata,
+ @HeaderParam("x-ms-encryption-key") String encryptionKey,
+ @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256,
+ @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm,
+ @HeaderParam("x-ms-encryption-scope") String encryptionScope,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("Accept") String accept, Context context);
+
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 202 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -616,7 +1077,109 @@ Mono> startCopyFromURLNoCustomHeaders(@HostParam("url") String ur
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 202 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
- Mono> copyFromURL(@HostParam("url") String url,
+ ResponseBase startCopyFromURLSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata,
+ @HeaderParam("x-ms-access-tier") AccessTier tier,
+ @HeaderParam("x-ms-rehydrate-priority") RehydratePriority rehydratePriority,
+ @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince,
+ @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince,
+ @HeaderParam("x-ms-source-if-match") String sourceIfMatch,
+ @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch,
+ @HeaderParam("x-ms-source-if-tags") String sourceIfTags,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-copy-source") String copySource,
+ @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString,
+ @HeaderParam("x-ms-seal-blob") Boolean sealBlob,
+ @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry,
+ @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode,
+ @HeaderParam("x-ms-legal-hold") Boolean legalHold, @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response startCopyFromURLNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map metadata,
+ @HeaderParam("x-ms-access-tier") AccessTier tier,
+ @HeaderParam("x-ms-rehydrate-priority") RehydratePriority rehydratePriority,
+ @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince,
+ @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince,
+ @HeaderParam("x-ms-source-if-match") String sourceIfMatch,
+ @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch,
+ @HeaderParam("x-ms-source-if-tags") String sourceIfTags,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-copy-source") String copySource,
+ @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-tags") String blobTagsString,
+ @HeaderParam("x-ms-seal-blob") Boolean sealBlob,
+ @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry,
+ @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode,
+ @HeaderParam("x-ms-legal-hold") Boolean legalHold, @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Mono> copyFromURL(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @HeaderParam("x-ms-requires-sync") String xMsRequiresSync, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-access-tier") AccessTier tier,
+ @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince,
+ @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince,
+ @HeaderParam("x-ms-source-if-match") String sourceIfMatch,
+ @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-copy-source") String copySource,
+ @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("x-ms-source-content-md5") String sourceContentMD5,
+ @HeaderParam("x-ms-tags") String blobTagsString,
+ @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry,
+ @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode,
+ @HeaderParam("x-ms-legal-hold") Boolean legalHold,
+ @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization,
+ @HeaderParam("x-ms-encryption-scope") String encryptionScope,
+ @HeaderParam("x-ms-copy-source-tag-option") BlobCopySourceTagsMode copySourceTags,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Mono> copyFromURLNoCustomHeaders(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @HeaderParam("x-ms-requires-sync") String xMsRequiresSync, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-access-tier") AccessTier tier,
+ @HeaderParam("x-ms-source-if-modified-since") DateTimeRfc1123 sourceIfModifiedSince,
+ @HeaderParam("x-ms-source-if-unmodified-since") DateTimeRfc1123 sourceIfUnmodifiedSince,
+ @HeaderParam("x-ms-source-if-match") String sourceIfMatch,
+ @HeaderParam("x-ms-source-if-none-match") String sourceIfNoneMatch,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-copy-source") String copySource,
+ @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("x-ms-source-content-md5") String sourceContentMD5,
+ @HeaderParam("x-ms-tags") String blobTagsString,
+ @HeaderParam("x-ms-immutability-policy-until-date") DateTimeRfc1123 immutabilityPolicyExpiry,
+ @HeaderParam("x-ms-immutability-policy-mode") BlobImmutabilityPolicyMode immutabilityPolicyMode,
+ @HeaderParam("x-ms-legal-hold") Boolean legalHold,
+ @HeaderParam("x-ms-copy-source-authorization") String copySourceAuthorization,
+ @HeaderParam("x-ms-encryption-scope") String encryptionScope,
+ @HeaderParam("x-ms-copy-source-tag-option") BlobCopySourceTagsMode copySourceTags,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 202 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase copyFromURLSync(@HostParam("url") String url,
@PathParam("containerName") String containerName, @PathParam("blob") String blob,
@HeaderParam("x-ms-requires-sync") String xMsRequiresSync, @QueryParam("timeout") Integer timeout,
@HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-access-tier") AccessTier tier,
@@ -643,7 +1206,7 @@ Mono> copyFromURL(@HostParam("url")
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 202 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
- Mono> copyFromURLNoCustomHeaders(@HostParam("url") String url,
+ Response copyFromURLNoCustomHeadersSync(@HostParam("url") String url,
@PathParam("containerName") String containerName, @PathParam("blob") String blob,
@HeaderParam("x-ms-requires-sync") String xMsRequiresSync, @QueryParam("timeout") Integer timeout,
@HeaderParam("x-ms-meta-") Map metadata, @HeaderParam("x-ms-access-tier") AccessTier tier,
@@ -689,6 +1252,28 @@ Mono> abortCopyFromURLNoCustomHeaders(@HostParam("url") String ur
@HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
Context context);
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 204 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase abortCopyFromURLSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-copy-action") String copyActionAbortConstant,
+ @QueryParam("copyid") String copyId, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 204 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response abortCopyFromURLNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-copy-action") String copyActionAbortConstant,
+ @QueryParam("copyid") String copyId, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("Accept") String accept,
+ Context context);
+
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 200, 202 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -715,6 +1300,32 @@ Mono> setTierNoCustomHeaders(@HostParam("url") String url,
@HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-tags") String ifTags,
@HeaderParam("Accept") String accept, Context context);
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase setTierSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot,
+ @QueryParam("versionid") String versionId, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-access-tier") AccessTier tier,
+ @HeaderParam("x-ms-rehydrate-priority") RehydratePriority rehydratePriority,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-tags") String ifTags,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 200, 202 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response setTierNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot,
+ @QueryParam("versionid") String versionId, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-access-tier") AccessTier tier,
+ @HeaderParam("x-ms-rehydrate-priority") RehydratePriority rehydratePriority,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @HeaderParam("x-ms-lease-id") String leaseId, @HeaderParam("x-ms-if-tags") String ifTags,
+ @HeaderParam("Accept") String accept, Context context);
+
@Get("/{containerName}/{blob}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -731,6 +1342,22 @@ Mono> getAccountInfoNoCustomHeaders(@HostParam("url") String url,
@QueryParam("restype") String restype, @QueryParam("comp") String comp,
@HeaderParam("x-ms-version") String version, @HeaderParam("Accept") String accept, Context context);
+ @Get("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase getAccountInfoSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("restype") String restype, @QueryParam("comp") String comp,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("Accept") String accept, Context context);
+
+ @Get("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response getAccountInfoNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("restype") String restype, @QueryParam("comp") String comp,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("Accept") String accept, Context context);
+
@Post("/{containerName}/{blob}")
@ExpectedResponses({ 200, 206 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -767,6 +1394,42 @@ Mono queryNoCustomHeaders(@HostParam("url") String url,
@BodyParam("application/xml") QueryRequest queryRequest, @HeaderParam("Accept") String accept,
Context context);
+ @Post("/{containerName}/{blob}")
+ @ExpectedResponses({ 200, 206 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase querySync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-encryption-key") String encryptionKey,
+ @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256,
+ @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId,
+ @BodyParam("application/xml") QueryRequest queryRequest, @HeaderParam("Accept") String accept,
+ Context context);
+
+ @Post("/{containerName}/{blob}")
+ @ExpectedResponses({ 200, 206 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response queryNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("snapshot") String snapshot,
+ @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("x-ms-encryption-key") String encryptionKey,
+ @HeaderParam("x-ms-encryption-key-sha256") String encryptionKeySha256,
+ @HeaderParam("x-ms-encryption-algorithm") EncryptionAlgorithmType encryptionAlgorithm,
+ @HeaderParam("If-Modified-Since") DateTimeRfc1123 ifModifiedSince,
+ @HeaderParam("If-Unmodified-Since") DateTimeRfc1123 ifUnmodifiedSince,
+ @HeaderParam("If-Match") String ifMatch, @HeaderParam("If-None-Match") String ifNoneMatch,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-version") String version,
+ @HeaderParam("x-ms-client-request-id") String requestId,
+ @BodyParam("application/xml") QueryRequest queryRequest, @HeaderParam("Accept") String accept,
+ Context context);
+
@Get("/{containerName}/{blob}")
@ExpectedResponses({ 200 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -789,6 +1452,28 @@ Mono> getTagsNoCustomHeaders(@HostParam("url") String url,
@HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-lease-id") String leaseId,
@HeaderParam("Accept") String accept, Context context);
+ @Get("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase getTagsSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Get("/{containerName}/{blob}")
+ @ExpectedResponses({ 200 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response getTagsNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @QueryParam("timeout") Integer timeout,
+ @HeaderParam("x-ms-version") String version, @HeaderParam("x-ms-client-request-id") String requestId,
+ @QueryParam("snapshot") String snapshot, @QueryParam("versionid") String versionId,
+ @HeaderParam("x-ms-if-tags") String ifTags, @HeaderParam("x-ms-lease-id") String leaseId,
+ @HeaderParam("Accept") String accept, Context context);
+
@Put("/{containerName}/{blob}")
@ExpectedResponses({ 204 })
@UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
@@ -814,6 +1499,32 @@ Mono> setTagsNoCustomHeaders(@HostParam("url") String url,
@HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-if-tags") String ifTags,
@HeaderParam("x-ms-lease-id") String leaseId, @BodyParam("application/xml") BlobTags tags,
@HeaderParam("Accept") String accept, Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 204 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ ResponseBase setTagsSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-version") String version,
+ @QueryParam("timeout") Integer timeout, @QueryParam("versionid") String versionId,
+ @HeaderParam("Content-MD5") String transactionalContentMD5,
+ @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-if-tags") String ifTags,
+ @HeaderParam("x-ms-lease-id") String leaseId, @BodyParam("application/xml") BlobTags tags,
+ @HeaderParam("Accept") String accept, Context context);
+
+ @Put("/{containerName}/{blob}")
+ @ExpectedResponses({ 204 })
+ @UnexpectedResponseExceptionType(BlobStorageExceptionInternal.class)
+ Response setTagsNoCustomHeadersSync(@HostParam("url") String url,
+ @PathParam("containerName") String containerName, @PathParam("blob") String blob,
+ @QueryParam("comp") String comp, @HeaderParam("x-ms-version") String version,
+ @QueryParam("timeout") Integer timeout, @QueryParam("versionid") String versionId,
+ @HeaderParam("Content-MD5") String transactionalContentMD5,
+ @HeaderParam("x-ms-content-crc64") String transactionalContentCrc64,
+ @HeaderParam("x-ms-client-request-id") String requestId, @HeaderParam("x-ms-if-tags") String ifTags,
+ @HeaderParam("x-ms-lease-id") String leaseId, @BodyParam("application/xml") BlobTags tags,
+ @HeaderParam("Accept") String accept, Context context);
}
/**
@@ -1039,18 +1750,157 @@ public Flux downloadAsync(String containerName, String blob, String
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
- * @return the response.
+ * @return the response.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Flux downloadAsync(String containerName, String blob, String snapshot, String versionId,
+ Integer timeout, String range, String leaseId, Boolean rangeGetContentMD5, Boolean rangeGetContentCRC64,
+ OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch,
+ String ifTags, String requestId, CpkInfo cpkInfo, Context context) {
+ return downloadWithResponseAsync(containerName, blob, snapshot, versionId, timeout, range, leaseId,
+ rangeGetContentMD5, rangeGetContentCRC64, ifModifiedSince, ifUnmodifiedSince, ifMatch, ifNoneMatch, ifTags,
+ requestId, cpkInfo, context)
+ .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException)
+ .flatMapMany(fluxByteBufferResponse -> fluxByteBufferResponse.getValue());
+ }
+
+ /**
+ * The Download operation reads or downloads a blob from the system, including its metadata and properties. You can
+ * also call Download to read a snapshot or version.
+ *
+ * @param containerName The container name.
+ * @param blob The blob name.
+ * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob
+ * snapshot to retrieve. For more information on working with blob snapshots, see <a
+ * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating
+ * a Snapshot of a Blob.</a>.
+ * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version
+ * of the blob to operate on. It's for service version 2019-10-10 and newer.
+ * @param timeout The timeout parameter is expressed in seconds. For more information, see <a
+ * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
+ * Timeouts for Blob Service Operations.</a>.
+ * @param range Return only the bytes of the blob in the specified range.
+ * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
+ * @param rangeGetContentMD5 When set to true and specified together with the Range, the service returns the MD5
+ * hash for the range, as long as the range is less than or equal to 4 MB in size.
+ * @param rangeGetContentCRC64 When set to true and specified together with the Range, the service returns the CRC64
+ * hash for the range, as long as the range is less than or equal to 4 MB in size.
+ * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the
+ * specified date/time.
+ * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since
+ * the specified date/time.
+ * @param ifMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value.
+ * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
+ * analytics logs when storage analytics logging is enabled.
+ * @param cpkInfo Parameter group.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response body on successful completion of {@link Mono}.
+ */
+ @ServiceMethod(returns = ReturnType.SINGLE)
+ public Mono downloadNoCustomHeadersWithResponseAsync(String containerName, String blob,
+ String snapshot, String versionId, Integer timeout, String range, String leaseId, Boolean rangeGetContentMD5,
+ Boolean rangeGetContentCRC64, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch,
+ String ifNoneMatch, String ifTags, String requestId, CpkInfo cpkInfo) {
+ final String accept = "application/xml";
+ String encryptionKeyInternal = null;
+ if (cpkInfo != null) {
+ encryptionKeyInternal = cpkInfo.getEncryptionKey();
+ }
+ String encryptionKey = encryptionKeyInternal;
+ String encryptionKeySha256Internal = null;
+ if (cpkInfo != null) {
+ encryptionKeySha256Internal = cpkInfo.getEncryptionKeySha256();
+ }
+ String encryptionKeySha256 = encryptionKeySha256Internal;
+ EncryptionAlgorithmType encryptionAlgorithmInternal = null;
+ if (cpkInfo != null) {
+ encryptionAlgorithmInternal = cpkInfo.getEncryptionAlgorithm();
+ }
+ EncryptionAlgorithmType encryptionAlgorithm = encryptionAlgorithmInternal;
+ DateTimeRfc1123 ifModifiedSinceConverted
+ = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
+ DateTimeRfc1123 ifUnmodifiedSinceConverted
+ = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
+ return FluxUtil
+ .withContext(context -> service.downloadNoCustomHeaders(this.client.getUrl(), containerName, blob, snapshot,
+ versionId, timeout, range, leaseId, rangeGetContentMD5, rangeGetContentCRC64, encryptionKey,
+ encryptionKeySha256, encryptionAlgorithm, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch,
+ ifNoneMatch, ifTags, this.client.getVersion(), requestId, accept, context))
+ .onErrorMap(BlobStorageExceptionInternal.class, ModelHelper::mapToBlobStorageException);
+ }
+
+ /**
+ * The Download operation reads or downloads a blob from the system, including its metadata and properties. You can
+ * also call Download to read a snapshot or version.
+ *
+ * @param containerName The container name.
+ * @param blob The blob name.
+ * @param snapshot The snapshot parameter is an opaque DateTime value that, when present, specifies the blob
+ * snapshot to retrieve. For more information on working with blob snapshots, see <a
+ * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/creating-a-snapshot-of-a-blob">Creating
+ * a Snapshot of a Blob.</a>.
+ * @param versionId The version id parameter is an opaque DateTime value that, when present, specifies the version
+ * of the blob to operate on. It's for service version 2019-10-10 and newer.
+ * @param timeout The timeout parameter is expressed in seconds. For more information, see <a
+ * href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations">Setting
+ * Timeouts for Blob Service Operations.</a>.
+ * @param range Return only the bytes of the blob in the specified range.
+ * @param leaseId If specified, the operation only succeeds if the resource's lease is active and matches this ID.
+ * @param rangeGetContentMD5 When set to true and specified together with the Range, the service returns the MD5
+ * hash for the range, as long as the range is less than or equal to 4 MB in size.
+ * @param rangeGetContentCRC64 When set to true and specified together with the Range, the service returns the CRC64
+ * hash for the range, as long as the range is less than or equal to 4 MB in size.
+ * @param ifModifiedSince Specify this header value to operate only on a blob if it has been modified since the
+ * specified date/time.
+ * @param ifUnmodifiedSince Specify this header value to operate only on a blob if it has not been modified since
+ * the specified date/time.
+ * @param ifMatch Specify an ETag value to operate only on blobs with a matching value.
+ * @param ifNoneMatch Specify an ETag value to operate only on blobs without a matching value.
+ * @param ifTags Specify a SQL where clause on blob tags to operate only on blobs with a matching value.
+ * @param requestId Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the
+ * analytics logs when storage analytics logging is enabled.
+ * @param cpkInfo Parameter group.
+ * @param context The context to associate with this operation.
+ * @throws IllegalArgumentException thrown if parameters fail the validation.
+ * @throws BlobStorageExceptionInternal thrown if the request is rejected by server.
+ * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
+ * @return the response body on successful completion of {@link Mono}.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
- public Flux