Skip to content
Merged
1 change: 1 addition & 0 deletions sdk/storage/azure-storage-blob/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Added support for setting and getting the StaticWebsite.DefaultIndexDocumentPath property on the service client.
- Added RehydratePriority to BlobProperties and BlobItemProperties.
- Fixed bug where Query Input Stream would throw when a ByteBuffer of length 0 was encountered.
- Added support to seal an append blob. Added AppendBlob.seal. Added ability to specify destinationSealed on BlobClient.beginCopy. isSealed property returned on getProperties/getBlob/listBlob.

## 12.8.0-beta.1 (2020-07-07)
- Added support for the 2019-12-12 service version.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private interface AppendBlobsService {
@Put("{containerName}/{blob}")
@ExpectedResponses({200})
@UnexpectedResponseExceptionType(BlobStorageException.class)
Mono<AppendBlobsSealResponse> seal(@HostParam("url") String url, @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, @QueryParam("comp") String comp, Context context);
Mono<AppendBlobsSealResponse> seal(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @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, @QueryParam("comp") String comp, Context context);
}

/**
Expand Down Expand Up @@ -383,12 +383,14 @@ public Mono<AppendBlobsAppendBlockFromUrlResponse> appendBlockFromUrlWithRestRes
/**
* 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 context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @return a Mono which performs the network request upon subscription.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<AppendBlobsSealResponse> sealWithRestResponseAsync(Context context) {
public Mono<AppendBlobsSealResponse> sealWithRestResponseAsync(String containerName, String blob, Context context) {
final Integer timeout = null;
final String requestId = null;
final String leaseId = null;
Expand All @@ -398,12 +400,14 @@ public Mono<AppendBlobsSealResponse> sealWithRestResponseAsync(Context context)
final String comp = "seal";
DateTimeRfc1123 ifModifiedSinceConverted = null;
DateTimeRfc1123 ifUnmodifiedSinceConverted = null;
return service.seal(this.client.getUrl(), timeout, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, appendPosition, comp, context);
return service.seal(containerName, blob, this.client.getUrl(), timeout, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, appendPosition, comp, context);
}

/**
* 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 &lt;a href="https://docs.microsoft.com/en-us/rest/api/storageservices/fileservices/setting-timeouts-for-blob-service-operations"&gt;Setting Timeouts for Blob Service Operations.&lt;/a&gt;.
* @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.
Expand All @@ -417,10 +421,10 @@ public Mono<AppendBlobsSealResponse> sealWithRestResponseAsync(Context context)
* @return a Mono which performs the network request upon subscription.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<AppendBlobsSealResponse> sealWithRestResponseAsync(Integer timeout, String requestId, String leaseId, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, Long appendPosition, Context context) {
public Mono<AppendBlobsSealResponse> sealWithRestResponseAsync(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";
DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
return service.seal(this.client.getUrl(), timeout, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, appendPosition, comp, context);
return service.seal(containerName, blob, this.client.getUrl(), timeout, this.client.getVersion(), requestId, leaseId, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, appendPosition, comp, context);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private interface BlobsService {
@Put("{containerName}/{blob}")
@ExpectedResponses({202})
@UnexpectedResponseExceptionType(BlobStorageException.class)
Mono<BlobsCopyFromURLResponse> copyFromURL(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map<String, String> 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") URL 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-seal-blob") Boolean sealBlob, @HeaderParam("x-ms-requires-sync") String xMsRequiresSync, Context context);
Mono<BlobsCopyFromURLResponse> copyFromURL(@PathParam("containerName") String containerName, @PathParam("blob") String blob, @HostParam("url") String url, @QueryParam("timeout") Integer timeout, @HeaderParam("x-ms-meta-") Map<String, String> 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") URL 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-requires-sync") String xMsRequiresSync, Context context);

@Put("{containerName}/{blob}")
@ExpectedResponses({204})
Expand Down Expand Up @@ -1232,14 +1232,13 @@ public Mono<BlobsCopyFromURLResponse> copyFromURLWithRestResponseAsync(String co
final String leaseId = null;
final String requestId = null;
final String blobTagsString = null;
final Boolean sealBlob = null;
final String xMsRequiresSync = "true";
DateTimeRfc1123 sourceIfModifiedSinceConverted = null;
DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = null;
DateTimeRfc1123 ifModifiedSinceConverted = null;
DateTimeRfc1123 ifUnmodifiedSinceConverted = null;
String sourceContentMD5Converted = null;
return service.copyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, sealBlob, xMsRequiresSync, context);
return service.copyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, xMsRequiresSync, context);
}

/**
Expand All @@ -1264,20 +1263,19 @@ public Mono<BlobsCopyFromURLResponse> copyFromURLWithRestResponseAsync(String co
* @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 sourceContentMD5 Specify the md5 calculated for the range of bytes that must be read from the copy source.
* @param blobTagsString Optional. Used to set blob tags in various blob operations.
* @param sealBlob Overrides the sealed state of the destination blob. Service version 2019-12-12 and newer.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @return a Mono which performs the network request upon subscription.
*/
@ServiceMethod(returns = ReturnType.SINGLE)
public Mono<BlobsCopyFromURLResponse> copyFromURLWithRestResponseAsync(String containerName, String blob, URL copySource, Integer timeout, Map<String, String> metadata, AccessTier tier, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String leaseId, String requestId, byte[] sourceContentMD5, String blobTagsString, Boolean sealBlob, Context context) {
public Mono<BlobsCopyFromURLResponse> copyFromURLWithRestResponseAsync(String containerName, String blob, URL copySource, Integer timeout, Map<String, String> metadata, AccessTier tier, OffsetDateTime sourceIfModifiedSince, OffsetDateTime sourceIfUnmodifiedSince, String sourceIfMatch, String sourceIfNoneMatch, OffsetDateTime ifModifiedSince, OffsetDateTime ifUnmodifiedSince, String ifMatch, String ifNoneMatch, String ifTags, String leaseId, String requestId, byte[] sourceContentMD5, String blobTagsString, Context context) {
final String xMsRequiresSync = "true";
DateTimeRfc1123 sourceIfModifiedSinceConverted = sourceIfModifiedSince == null ? null : new DateTimeRfc1123(sourceIfModifiedSince);
DateTimeRfc1123 sourceIfUnmodifiedSinceConverted = sourceIfUnmodifiedSince == null ? null : new DateTimeRfc1123(sourceIfUnmodifiedSince);
DateTimeRfc1123 ifModifiedSinceConverted = ifModifiedSince == null ? null : new DateTimeRfc1123(ifModifiedSince);
DateTimeRfc1123 ifUnmodifiedSinceConverted = ifUnmodifiedSince == null ? null : new DateTimeRfc1123(ifUnmodifiedSince);
String sourceContentMD5Converted = Base64Util.encodeToString(sourceContentMD5);
return service.copyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, sealBlob, xMsRequiresSync, context);
return service.copyFromURL(containerName, blob, this.client.getUrl(), timeout, metadata, tier, sourceIfModifiedSinceConverted, sourceIfUnmodifiedSinceConverted, sourceIfMatch, sourceIfNoneMatch, ifModifiedSinceConverted, ifUnmodifiedSinceConverted, ifMatch, ifNoneMatch, ifTags, copySource, leaseId, this.client.getVersion(), requestId, sourceContentMD5Converted, blobTagsString, xMsRequiresSync, context);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ public final class BlobItemPropertiesInternal {
/*
* The isSealed property.
*/
@JsonProperty(value = "IsSealed")
@JsonProperty(value = "Sealed")
private Boolean isSealed;

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ public static com.azure.storage.blob.models.BlobDownloadHeaders populateBlobDown
objectReplicationSourcePolicies.add(new ObjectReplicationPolicy(entry.getKey(), entry.getValue()));
}
headers.setObjectReplicationSourcePolicies(objectReplicationSourcePolicies);
headers.setSealed(internalHeaders.isSealed());

return headers;
}
Expand Down Expand Up @@ -252,6 +253,7 @@ public static BlobItemProperties populateBlobItemProperties(BlobItemPropertiesIn
blobItemProperties.setAccessTierChangeTime(blobItemPropertiesInternal.getAccessTierChangeTime());
blobItemProperties.setTagCount(blobItemPropertiesInternal.getTagCount());
blobItemProperties.setRehydratePriority(blobItemPropertiesInternal.getRehydratePriority());
blobItemProperties.setSealed(blobItemPropertiesInternal.isSealed());

return blobItemProperties;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,12 @@ public final class BlobDownloadHeaders {
@JsonProperty(value = "x-ms-error-code")
private String errorCode;

/*
* The isSealed property.
*/
@JsonProperty(value = "IsSealed")
private Boolean sealed;

/**
* Get the lastModified property: Returns the date and time the container
* was last modified. Any operation that modifies the blob, including an
Expand Down Expand Up @@ -1251,4 +1257,24 @@ public BlobDownloadHeaders setErrorCode(String errorCode) {
this.errorCode = errorCode;
return this;
}

/**
* Get the sealed property: The sealed property.
*
* @return the isSealed value.
*/
public Boolean isSealed() {
return this.sealed;
}

/**
* Set the sealed property: The sealed property.
*
* @param sealed the sealed value to set.
* @return the BlobDownloadHeaders object itself.
*/
public BlobDownloadHeaders setSealed(Boolean sealed) {
this.sealed = sealed;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,12 @@ public final class BlobItemProperties {
@JsonProperty(value = "RehydratePriority")
private RehydratePriority rehydratePriority;

/*
* The sealed property.
*/
@JsonProperty(value = "Sealed")
private Boolean sealed;

/**
* Get the creationTime property: The creationTime property.
*
Expand Down Expand Up @@ -932,4 +938,24 @@ public BlobItemProperties setRehydratePriority(RehydratePriority rehydratePriori
this.rehydratePriority = rehydratePriority;
return this;
}

/**
* Get the sealed property: The sealed property.
*
* @return the isSealed value.
*/
public Boolean isSealed() {
return this.sealed;
}

/**
* Set the sealed property: The sealed property.
*
* @param sealed the sealed value to set.
* @return the BlobItemProperties object itself.
*/
public BlobItemProperties setSealed(Boolean sealed) {
this.sealed = sealed;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public final class BlobProperties {
private final List<ObjectReplicationPolicy> objectReplicationSourcePolicies;
private final String objectReplicationDestinationPolicyId;
private final RehydratePriority rehydratePriority;
private final Boolean isSealed;

/**
* Constructs a {@link BlobProperties}.
Expand Down Expand Up @@ -157,6 +158,7 @@ public BlobProperties(final OffsetDateTime creationTime, final OffsetDateTime la
* @param tagCount Number of tags associated with the blob.
* @param objectReplicationStatus The object replication status map to parse.
* @param rehydratePriority The rehydrate priority
* @param isSealed Whether or not the blob is sealed.
*/
public BlobProperties(final OffsetDateTime creationTime, final OffsetDateTime lastModified, final String eTag,
final long blobSize, final String contentType, final byte[] contentMd5, final String contentEncoding,
Expand All @@ -169,7 +171,8 @@ public BlobProperties(final OffsetDateTime creationTime, final OffsetDateTime la
final Boolean isAccessTierInferred, final ArchiveStatus archiveStatus, final String encryptionKeySha256,
final String encryptionScope, final OffsetDateTime accessTierChangeTime, final Map<String, String> metadata,
final Integer committedBlockCount, final String versionId, final Boolean isCurrentVersion,
final Long tagCount, Map<String, String> objectReplicationStatus, String rehydratePriority) {
final Long tagCount, Map<String, String> objectReplicationStatus, final String rehydratePriority,
final Boolean isSealed) {
this.creationTime = creationTime;
this.lastModified = lastModified;
this.eTag = eTag;
Expand Down Expand Up @@ -227,6 +230,7 @@ public BlobProperties(final OffsetDateTime creationTime, final OffsetDateTime la
this.objectReplicationSourcePolicies.add(new ObjectReplicationPolicy(entry.getKey(), entry.getValue()));
}
this.rehydratePriority = RehydratePriority.fromString(rehydratePriority);
this.isSealed = isSealed;
}


Expand Down Expand Up @@ -326,6 +330,7 @@ public BlobProperties(final OffsetDateTime creationTime, final OffsetDateTime la
this.objectReplicationSourcePolicies = objectReplicationSourcePolicies;
this.objectReplicationDestinationPolicyId = objectReplicationDestinationPolicyId;
this.rehydratePriority = null;
this.isSealed = null;
}

/**
Expand Down Expand Up @@ -607,4 +612,11 @@ public String getObjectReplicationDestinationPolicyId() {
public RehydratePriority getRehydratePriority() {
return this.rehydratePriority;
}

/**
* @return the flag indicating whether or not this blob has been sealed.
*/
public Boolean isSealed() {
return isSealed;
}
}
Loading