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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sdk/storage/azure-storage-file-share/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "java",
"TagPrefix": "java/storage/azure-storage-file-share",
"Tag": "java/storage/azure-storage-file-share_bf4bf2f437"
"Tag": "java/storage/azure-storage-file-share_e7a870d29a"
}
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ public Mono<Response<ShareInfo>> createWithResponse(ShareCreateOptions options)
}

Mono<Response<ShareInfo>> createWithResponse(ShareCreateOptions options, Context context) {
context = context == null ? Context.NONE : context;
options = options == null ? new ShareCreateOptions() : options;
String enabledProtocol = options.getProtocols() == null ? null : options.getProtocols().toString();
enabledProtocol = "".equals(enabledProtocol) ? null : enabledProtocol;
Expand All @@ -370,7 +369,8 @@ Mono<Response<ShareInfo>> createWithResponse(ShareCreateOptions options, Context
options.getAccessTier(), enabledProtocol, options.getRootSquash(),
options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(),
options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(),
options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), context)
options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(),
options.isEnableSmbDirectoryLease())
.map(ModelHelper::mapToShareInfoResponse);
}

Expand Down Expand Up @@ -933,13 +933,13 @@ Mono<Response<ShareInfo>> setPropertiesWithResponse(ShareSetPropertiesOptions op
StorageImplUtils.assertNotNull("options", options);
ShareRequestConditions requestConditions
= options.getRequestConditions() == null ? new ShareRequestConditions() : options.getRequestConditions();
context = context == null ? Context.NONE : context;
return azureFileStorageClient.getShares()
.setPropertiesNoCustomHeadersWithResponseAsync(shareName, null, options.getQuotaInGb(),
options.getAccessTier(), requestConditions.getLeaseId(), options.getRootSquash(),
options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(),
options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(),
options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), context)
options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(),
options.isEnableSmbDirectoryLease())
.map(ModelHelper::mapToShareInfoResponse);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,8 @@ public Response<ShareInfo> createWithResponse(ShareCreateOptions options, Durati
finalOptions.getAccessTier(), finalEnabledProtocol, finalOptions.getRootSquash(),
finalOptions.isSnapshotVirtualDirectoryAccessEnabled(), finalOptions.isPaidBurstingEnabled(),
finalOptions.getPaidBurstingMaxBandwidthMibps(), finalOptions.getPaidBurstingMaxIops(),
finalOptions.getProvisionedMaxIops(), finalOptions.getProvisionedMaxBandwidthMibps(), finalContext);
finalOptions.getProvisionedMaxIops(), finalOptions.getProvisionedMaxBandwidthMibps(),
finalOptions.isEnableSmbDirectoryLease(), finalContext);

return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class));
}
Expand Down Expand Up @@ -897,7 +898,8 @@ public Response<ShareInfo> setPropertiesWithResponse(ShareSetPropertiesOptions o
requestConditions.getLeaseId(), options.getRootSquash(),
options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(),
options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(),
options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), finalContext);
options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(),
options.isEnableSmbDirectoryLease(), finalContext);

return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class));
}
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,12 @@ public final class SharePropertiesInternal implements XmlSerializable<SharePrope
@Generated
private DateTimeRfc1123 nextAllowedProvisionedBandwidthDowngradeTime;

/*
* The EnableSmbDirectoryLease property.
*/
@Generated
private Boolean enableSmbDirectoryLease;

/*
* Dictionary of <string>
*/
Expand Down Expand Up @@ -819,6 +825,28 @@ public OffsetDateTime getNextAllowedProvisionedBandwidthDowngradeTime() {
return this;
}

/**
* Get the enableSmbDirectoryLease property: The EnableSmbDirectoryLease property.
*
* @return the enableSmbDirectoryLease value.
*/
@Generated
public Boolean isEnableSmbDirectoryLease() {
return this.enableSmbDirectoryLease;
}

/**
* Set the enableSmbDirectoryLease property: The EnableSmbDirectoryLease property.
*
* @param enableSmbDirectoryLease the enableSmbDirectoryLease value to set.
* @return the SharePropertiesInternal object itself.
*/
@Generated
public SharePropertiesInternal setEnableSmbDirectoryLease(Boolean enableSmbDirectoryLease) {
this.enableSmbDirectoryLease = enableSmbDirectoryLease;
return this;
}

/**
* Get the metadata property: Dictionary of &lt;string&gt;.
*
Expand Down Expand Up @@ -884,6 +912,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt
Objects.toString(this.nextAllowedProvisionedIopsDowngradeTime, null));
xmlWriter.writeStringElement("NextAllowedProvisionedBandwidthDowngradeTime",
Objects.toString(this.nextAllowedProvisionedBandwidthDowngradeTime, null));
xmlWriter.writeBooleanElement("EnableSmbDirectoryLease", this.enableSmbDirectoryLease);
if (this.metadata != null) {
xmlWriter.writeStartElement("Metadata");
for (Map.Entry<String, String> entry : this.metadata.entrySet()) {
Expand Down Expand Up @@ -996,6 +1025,9 @@ public static SharePropertiesInternal fromXml(XmlReader xmlReader, String rootEl
} else if ("NextAllowedProvisionedBandwidthDowngradeTime".equals(elementName.getLocalPart())) {
deserializedSharePropertiesInternal.nextAllowedProvisionedBandwidthDowngradeTime
= reader.getNullableElement(DateTimeRfc1123::new);
} else if ("EnableSmbDirectoryLease".equals(elementName.getLocalPart())) {
deserializedSharePropertiesInternal.enableSmbDirectoryLease
= reader.getNullableElement(Boolean::parseBoolean);
} else if ("Metadata".equals(elementName.getLocalPart())) {
while (reader.nextElement() != XmlToken.END_ELEMENT) {
if (deserializedSharePropertiesInternal.metadata == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@ public final class SharesGetPropertiesHeaders {
@Generated
private LeaseDurationType xMsLeaseDuration;

/*
* The x-ms-enable-smb-directory-lease property.
*/
@Generated
private Boolean xMsEnableSmbDirectoryLease;

/*
* The x-ms-request-id property.
*/
Expand Down Expand Up @@ -223,6 +229,9 @@ public final class SharesGetPropertiesHeaders {

private static final HttpHeaderName X_MS_LEASE_DURATION = HttpHeaderName.fromString("x-ms-lease-duration");

private static final HttpHeaderName X_MS_ENABLE_SMB_DIRECTORY_LEASE
= HttpHeaderName.fromString("x-ms-enable-smb-directory-lease");

private static final HttpHeaderName X_MS_ACCESS_TIER_TRANSITION_STATE
= HttpHeaderName.fromString("x-ms-access-tier-transition-state");

Expand Down Expand Up @@ -333,6 +342,12 @@ public SharesGetPropertiesHeaders(HttpHeaders rawHeaders) {
} else {
this.xMsLeaseDuration = null;
}
String xMsEnableSmbDirectoryLease = rawHeaders.getValue(X_MS_ENABLE_SMB_DIRECTORY_LEASE);
if (xMsEnableSmbDirectoryLease != null) {
this.xMsEnableSmbDirectoryLease = Boolean.parseBoolean(xMsEnableSmbDirectoryLease);
} else {
this.xMsEnableSmbDirectoryLease = null;
}
this.xMsRequestId = rawHeaders.getValue(HttpHeaderName.X_MS_REQUEST_ID);
this.xMsAccessTierTransitionState = rawHeaders.getValue(X_MS_ACCESS_TIER_TRANSITION_STATE);
String xMsShareNextAllowedQuotaDowngradeTime
Expand Down Expand Up @@ -734,6 +749,28 @@ public SharesGetPropertiesHeaders setXMsLeaseDuration(LeaseDurationType xMsLease
return this;
}

/**
* Get the xMsEnableSmbDirectoryLease property: The x-ms-enable-smb-directory-lease property.
*
* @return the xMsEnableSmbDirectoryLease value.
*/
@Generated
public Boolean isXMsEnableSmbDirectoryLease() {
return this.xMsEnableSmbDirectoryLease;
}

/**
* Set the xMsEnableSmbDirectoryLease property: The x-ms-enable-smb-directory-lease property.
*
* @param xMsEnableSmbDirectoryLease the xMsEnableSmbDirectoryLease value to set.
* @return the SharesGetPropertiesHeaders object itself.
*/
@Generated
public SharesGetPropertiesHeaders setXMsEnableSmbDirectoryLease(Boolean xMsEnableSmbDirectoryLease) {
this.xMsEnableSmbDirectoryLease = xMsEnableSmbDirectoryLease;
return this;
}

/**
* Get the xMsRequestId property: The x-ms-request-id property.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,7 @@ public static ShareProperties populateShareProperties(SharePropertiesInternal sh
sharePropertiesInternal.getNextAllowedProvisionedIopsDowngradeTime());
properties.setNextAllowedProvisionedBandwidthDowngradeTime(
sharePropertiesInternal.getNextAllowedProvisionedBandwidthDowngradeTime());
properties.setEnableSmbDirectoryLease(sharePropertiesInternal.isEnableSmbDirectoryLease());

return properties;
}
Expand Down Expand Up @@ -517,7 +518,8 @@ public static Response<ShareInfo> mapToShareInfoResponse(Response<?> response) {
.setMaxBurstCreditsForIops(headers.getXMsShareMaxBurstCreditsForIops())
.setNextAllowedProvisionedIopsDowngradeTime(headers.getXMsShareNextAllowedProvisionedIopsDowngradeTime())
.setNextAllowedProvisionedBandwidthDowngradeTime(
headers.getXMsShareNextAllowedProvisionedBandwidthDowngradeTime());
headers.getXMsShareNextAllowedProvisionedBandwidthDowngradeTime())
.setEnableSmbDirectoryLease(headers.isXMsEnableSmbDirectoryLease());

return new SimpleResponse<>(response, shareProperties);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,12 @@ public final class ShareProperties implements XmlSerializable<ShareProperties> {
*/
private OffsetDateTime nextAllowedProvisionedBandwidthDowngradeTime;

/*
* Optional, default value is true. Only applicable to SMB shares.
* Specifies whether granting of new directory leases for directories present in a share are to be enabled or disabled.
*/
private Boolean enableSmbDirectoryLease;

/**
* Creates a new instance of {@link ShareProperties}.
*/
Expand Down Expand Up @@ -796,6 +802,30 @@ public OffsetDateTime getNextAllowedProvisionedBandwidthDowngradeTime() {
return this;
}

/**
* Optional, default value is true. Only applicable to SMB shares.
* Specifies whether granting of new directory leases for directories present in a share are to be enabled or disabled.
* An input of true specifies that granting of new directory leases is to be allowed.
* An input of false specifies that granting of new directory leases is to be blocked.
* @return the enableSmbDirectoryLease value.
*/
public Boolean isEnableSmbDirectoryLease() {
return enableSmbDirectoryLease;
}

/**
* Optional, default value is true. Only applicable to SMB shares.
* Specifies whether granting of new directory leases for directories present in a share are to be enabled or disabled.
* An input of true specifies that granting of new directory leases is to be allowed.
* An input of false specifies that granting of new directory leases is to be blocked.
* @param enableSmbDirectoryLease the enableSmbDirectoryLease value to set.
* @return the ShareProperties object itself.
*/
public ShareProperties setEnableSmbDirectoryLease(Boolean enableSmbDirectoryLease) {
this.enableSmbDirectoryLease = enableSmbDirectoryLease;
return this;
}

@Override
public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException {
return toXml(xmlWriter, null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ public class ShareCreateOptions {
private Long paidBurstingMaxBandwidthMibps;
private Long provisionedMaxIops;
private Long provisionedMaxBandwidthMibps;
private Boolean enableSmbDirectoryLease;

/**
* Creates a new instance of {@link ShareCreateOptions}.
Expand Down Expand Up @@ -277,4 +278,28 @@ public ShareCreateOptions setProvisionedMaxBandwidthMibps(Long provisionedMaxBan
this.provisionedMaxBandwidthMibps = provisionedMaxBandwidthMibps;
return this;
}

/**
* Optional, default value is true. Only applicable to SMB shares.
* Specifies whether granting of new directory leases for directories present in a share are to be enabled or disabled.
* An input of true specifies that granting of new directory leases is to be allowed.
* An input of false specifies that granting of new directory leases is to be blocked.
* @return the enableSmbDirectoryLease value.
*/
public Boolean isEnableSmbDirectoryLease() {
return enableSmbDirectoryLease;
}

/**
* Optional, default value is true. Only applicable to SMB shares.
* Specifies whether granting of new directory leases for directories present in a share are to be enabled or disabled.
* An input of true specifies that granting of new directory leases is to be allowed.
* An input of false specifies that granting of new directory leases is to be blocked.
* @param enableSmbDirectoryLease the enableSmbDirectoryLease value to set.
* @return the ShareCreateOptions object itself.
*/
public ShareCreateOptions setEnableSmbDirectoryLease(Boolean enableSmbDirectoryLease) {
this.enableSmbDirectoryLease = enableSmbDirectoryLease;
return this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public class ShareSetPropertiesOptions {
private Long paidBurstingMaxBandwidthMibps;
private Long provisionedMaxIops;
private Long provisionedMaxBandwidthMibps;
private Boolean enableSmbDirectoryLease;

/**
* Creates a new instance of {@link ShareSetPropertiesOptions}.
Expand Down Expand Up @@ -256,4 +257,28 @@ public ShareSetPropertiesOptions setProvisionedMaxBandwidthMibps(Long provisione
this.provisionedMaxBandwidthMibps = provisionedMaxBandwidthMibps;
return this;
}

/**
* Optional, default value is true. Only applicable to SMB shares.
* Specifies whether granting of new directory leases for directories present in a share are to be enabled or disabled.
* An input of true specifies that granting of new directory leases is to be allowed.
* An input of false specifies that granting of new directory leases is to be blocked.
* @return the enableSmbDirectoryLease value.
*/
public Boolean isEnableSmbDirectoryLease() {
return enableSmbDirectoryLease;
}

/**
* Optional, default value is true. Only applicable to SMB shares.
* Specifies whether granting of new directory leases for directories present in a share are to be enabled or disabled.
* An input of true specifies that granting of new directory leases is to be allowed.
* An input of false specifies that granting of new directory leases is to be blocked.
* @param enableSmbDirectoryLease the enableSmbDirectoryLease value to set.
* @return the ShareSetPropertiesOptions object itself.
*/
public ShareSetPropertiesOptions setEnableSmbDirectoryLease(Boolean enableSmbDirectoryLease) {
this.enableSmbDirectoryLease = enableSmbDirectoryLease;
return this;
}
}
Loading