From 65f6620c480c5460c98e63779d0a4f4b5b05064f Mon Sep 17 00:00:00 2001 From: browndav Date: Fri, 2 Oct 2026 10:31:11 -0400 Subject: [PATCH 01/13] Restore missing listAllRanges recordings in file share assets --- sdk/storage/azure-storage-file-share/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/azure-storage-file-share/assets.json b/sdk/storage/azure-storage-file-share/assets.json index eabc0bb2c022e..92a17c9561e63 100644 --- a/sdk/storage/azure-storage-file-share/assets.json +++ b/sdk/storage/azure-storage-file-share/assets.json @@ -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_741d1f4fbd" + "Tag": "java/storage/azure-storage-file-share_679d0d8151" } From 8431aea8b2363cd3f2aa892a15e0fdb09492059c Mon Sep 17 00:00:00 2001 From: browndav Date: Fri, 2 Oct 2026 14:54:35 -0400 Subject: [PATCH 02/13] autorest --- .../file/share/implementation/SharesImpl.java | 231 +++++++++++++----- .../models/SharesGetPropertiesHeaders.java | 110 +++++++++ .../swagger/README.md | 2 +- 3 files changed, 282 insertions(+), 61 deletions(-) diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java index 1ce207620adcf..bfe9dda7e96b0 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/SharesImpl.java @@ -104,6 +104,8 @@ Mono> create(@HostParam("url") String ur @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, + @HeaderParam("x-ms-file-enable-change-feed") Boolean fileEnableChangeFeed, + @HeaderParam("x-ms-file-change-feed-retention-in-days") Integer fileChangeFeedRetentionInDays, @HeaderParam("Accept") String accept, Context context); @Put("/{shareName}") @@ -123,6 +125,8 @@ Mono> createNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, + @HeaderParam("x-ms-file-enable-change-feed") Boolean fileEnableChangeFeed, + @HeaderParam("x-ms-file-change-feed-retention-in-days") Integer fileChangeFeedRetentionInDays, @HeaderParam("Accept") String accept, Context context); @Put("/{shareName}") @@ -142,6 +146,8 @@ ResponseBase createSync(@HostParam("url") String url, @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, + @HeaderParam("x-ms-file-enable-change-feed") Boolean fileEnableChangeFeed, + @HeaderParam("x-ms-file-change-feed-retention-in-days") Integer fileChangeFeedRetentionInDays, @HeaderParam("Accept") String accept, Context context); @Put("/{shareName}") @@ -161,6 +167,8 @@ Response createNoCustomHeadersSync(@HostParam("url") String url, @PathPara @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, + @HeaderParam("x-ms-file-enable-change-feed") Boolean fileEnableChangeFeed, + @HeaderParam("x-ms-file-change-feed-retention-in-days") Integer fileChangeFeedRetentionInDays, @HeaderParam("Accept") String accept, Context context); @Get("/{shareName}") @@ -635,6 +643,8 @@ Mono> setProperties(@HostParam("u @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, + @HeaderParam("x-ms-file-enable-change-feed") Boolean fileEnableChangeFeed, + @HeaderParam("x-ms-file-change-feed-retention-in-days") Integer fileChangeFeedRetentionInDays, @HeaderParam("Accept") String accept, Context context); @Put("/{shareName}") @@ -654,6 +664,8 @@ Mono> setPropertiesNoCustomHeaders(@HostParam("url") String url, @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, + @HeaderParam("x-ms-file-enable-change-feed") Boolean fileEnableChangeFeed, + @HeaderParam("x-ms-file-change-feed-retention-in-days") Integer fileChangeFeedRetentionInDays, @HeaderParam("Accept") String accept, Context context); @Put("/{shareName}") @@ -673,6 +685,8 @@ ResponseBase setPropertiesSync(@HostParam("url @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, + @HeaderParam("x-ms-file-enable-change-feed") Boolean fileEnableChangeFeed, + @HeaderParam("x-ms-file-change-feed-retention-in-days") Integer fileChangeFeedRetentionInDays, @HeaderParam("Accept") String accept, Context context); @Put("/{shareName}") @@ -692,6 +706,8 @@ Response setPropertiesNoCustomHeadersSync(@HostParam("url") String url, @HeaderParam("x-ms-share-provisioned-iops") Long shareProvisionedIops, @HeaderParam("x-ms-share-provisioned-bandwidth-mibps") Long shareProvisionedBandwidthMibps, @HeaderParam("x-ms-enable-smb-directory-lease") Boolean enableSmbDirectoryLease, + @HeaderParam("x-ms-file-enable-change-feed") Boolean fileEnableChangeFeed, + @HeaderParam("x-ms-file-change-feed-retention-in-days") Integer fileChangeFeedRetentionInDays, @HeaderParam("Accept") String accept, Context context); @Put("/{shareName}") @@ -943,6 +959,10 @@ Response restoreNoCustomHeadersSync(@HostParam("url") String url, * 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 fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -953,12 +973,12 @@ public Mono> createWithResponseAsync(Str Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease) { - return FluxUtil - .withContext(context -> createWithResponseAsync(shareName, timeout, metadata, quota, accessTier, - enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, - paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, - shareProvisionedBandwidthMibps, enableSmbDirectoryLease, context)) + Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, + Integer fileChangeFeedRetentionInDays) { + return FluxUtil.withContext(context -> createWithResponseAsync(shareName, timeout, metadata, quota, accessTier, + enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, + paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } @@ -992,6 +1012,10 @@ public Mono> createWithResponseAsync(Str * 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 fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -1003,13 +1027,16 @@ public Mono> createWithResponseAsync(Str Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Context context) { + Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, + Integer fileChangeFeedRetentionInDays, Context context) { final String restype = "share"; final String accept = "application/xml"; - return service.create(this.client.getUrl(), shareName, restype, timeout, metadata, quota, accessTier, - this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, accept, context) + return service + .create(this.client.getUrl(), shareName, restype, timeout, metadata, quota, accessTier, + this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, + paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, + this.client.getFileRequestIntent(), shareProvisionedIops, shareProvisionedBandwidthMibps, + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, accept, context) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } @@ -1043,6 +1070,10 @@ public Mono> createWithResponseAsync(Str * 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 fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1053,10 +1084,11 @@ public Mono createAsync(String shareName, Integer timeout, Map Mono.empty()); } @@ -1091,6 +1123,10 @@ public Mono createAsync(String shareName, Integer timeout, Map createAsync(String shareName, Integer timeout, Map Mono.empty()); } @@ -1140,6 +1178,10 @@ public Mono createAsync(String shareName, Integer timeout, Map> createNoCustomHeadersWithResponseAsync(String shareN Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease) { - return FluxUtil - .withContext(context -> createNoCustomHeadersWithResponseAsync(shareName, timeout, metadata, quota, - accessTier, enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, - paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, - shareProvisionedBandwidthMibps, enableSmbDirectoryLease, context)) + Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, + Integer fileChangeFeedRetentionInDays) { + return FluxUtil.withContext(context -> createNoCustomHeadersWithResponseAsync(shareName, timeout, metadata, + quota, accessTier, enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, + paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } @@ -1189,6 +1231,10 @@ public Mono> createNoCustomHeadersWithResponseAsync(String shareN * 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 fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -1200,13 +1246,16 @@ public Mono> createNoCustomHeadersWithResponseAsync(String shareN Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Context context) { + Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, + Integer fileChangeFeedRetentionInDays, Context context) { final String restype = "share"; final String accept = "application/xml"; - return service.createNoCustomHeaders(this.client.getUrl(), shareName, restype, timeout, metadata, quota, - accessTier, this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, accept, context) + return service + .createNoCustomHeaders(this.client.getUrl(), shareName, restype, timeout, metadata, quota, accessTier, + this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, + paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, + this.client.getFileRequestIntent(), shareProvisionedIops, shareProvisionedBandwidthMibps, + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, accept, context) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } @@ -1240,6 +1289,10 @@ public Mono> createNoCustomHeadersWithResponseAsync(String shareN * 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 fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -1251,7 +1304,8 @@ public ResponseBase createWithResponse(String shareNa Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Context context) { + Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, + Integer fileChangeFeedRetentionInDays, Context context) { try { final String restype = "share"; final String accept = "application/xml"; @@ -1259,7 +1313,7 @@ public ResponseBase createWithResponse(String shareNa this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), shareProvisionedIops, shareProvisionedBandwidthMibps, - enableSmbDirectoryLease, accept, context); + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, accept, context); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } @@ -1295,6 +1349,10 @@ public ResponseBase createWithResponse(String shareNa * 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 fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -1304,11 +1362,11 @@ public void create(String shareName, Integer timeout, Map metada ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease) { + Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays) { createWithResponse(shareName, timeout, metadata, quota, accessTier, enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, - Context.NONE); + fileEnableChangeFeed, fileChangeFeedRetentionInDays, Context.NONE); } /** @@ -1341,6 +1399,10 @@ public void create(String shareName, Integer timeout, Map metada * 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 fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -1352,7 +1414,8 @@ public Response createNoCustomHeadersWithResponse(String shareName, Intege Map metadata, Integer quota, ShareAccessTier accessTier, String enabledProtocols, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, - Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Context context) { + Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, + Integer fileChangeFeedRetentionInDays, Context context) { try { final String restype = "share"; final String accept = "application/xml"; @@ -1360,7 +1423,8 @@ public Response createNoCustomHeadersWithResponse(String shareName, Intege accessTier, this.client.getVersion(), enabledProtocols, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), shareProvisionedIops, - shareProvisionedBandwidthMibps, enableSmbDirectoryLease, accept, context); + shareProvisionedBandwidthMibps, enableSmbDirectoryLease, fileEnableChangeFeed, + fileChangeFeedRetentionInDays, accept, context); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } @@ -4012,6 +4076,10 @@ public Response getPermissionNoCustomHeadersWithResponse(String * 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 fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -4022,11 +4090,12 @@ public Mono> setPropertiesWithRes Integer timeout, Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease) { - return FluxUtil.withContext(context -> setPropertiesWithResponseAsync(shareName, timeout, quota, accessTier, - leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, - paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, - enableSmbDirectoryLease, context)) + Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays) { + return FluxUtil + .withContext(context -> setPropertiesWithResponseAsync(shareName, timeout, quota, accessTier, leaseId, + rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, + paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, + fileEnableChangeFeed, fileChangeFeedRetentionInDays, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } @@ -4058,6 +4127,10 @@ public Mono> setPropertiesWithRes * 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 fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -4069,7 +4142,8 @@ public Mono> setPropertiesWithRes Integer timeout, Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease, Context context) { + Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays, + Context context) { final String restype = "share"; final String comp = "properties"; final String accept = "application/xml"; @@ -4077,7 +4151,8 @@ public Mono> setPropertiesWithRes .setProperties(this.client.getUrl(), shareName, restype, comp, timeout, this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, accept, context) + shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, fileEnableChangeFeed, + fileChangeFeedRetentionInDays, accept, context) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } @@ -4109,6 +4184,10 @@ public Mono> setPropertiesWithRes * 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 fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -4118,10 +4197,12 @@ public Mono> setPropertiesWithRes public Mono setPropertiesAsync(String shareName, Integer timeout, Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, - Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease) { + Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, + Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays) { return setPropertiesWithResponseAsync(shareName, timeout, quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease) + paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, + fileEnableChangeFeed, fileChangeFeedRetentionInDays) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } @@ -4154,6 +4235,10 @@ public Mono setPropertiesAsync(String shareName, Integer timeout, Integer * 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 fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -4165,10 +4250,11 @@ public Mono setPropertiesAsync(String shareName, Integer timeout, Integer String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, - Context context) { + Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays, Context context) { return setPropertiesWithResponseAsync(shareName, timeout, quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, - paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, context) + paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, + fileEnableChangeFeed, fileChangeFeedRetentionInDays, context) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException) .flatMap(ignored -> Mono.empty()); } @@ -4201,6 +4287,10 @@ public Mono setPropertiesAsync(String shareName, Integer timeout, Integer * 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 fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -4211,12 +4301,11 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease) { - return FluxUtil - .withContext(context -> setPropertiesNoCustomHeadersWithResponseAsync(shareName, timeout, quota, accessTier, - leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, - paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, - shareProvisionedBandwidthMibps, enableSmbDirectoryLease, context)) + Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays) { + return FluxUtil.withContext(context -> setPropertiesNoCustomHeadersWithResponseAsync(shareName, timeout, quota, + accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, + paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, context)) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } @@ -4248,6 +4337,10 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String * 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 fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -4259,14 +4352,17 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease, Context context) { + Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays, + Context context) { final String restype = "share"; final String comp = "properties"; final String accept = "application/xml"; - return service.setPropertiesNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, - this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, - paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), - shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, accept, context) + return service + .setPropertiesNoCustomHeaders(this.client.getUrl(), shareName, restype, comp, timeout, + this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, + paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, + this.client.getFileRequestIntent(), shareProvisionedIops, shareProvisionedBandwidthMibps, + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, accept, context) .onErrorMap(ShareStorageExceptionInternal.class, ModelHelper::mapToShareStorageException); } @@ -4298,6 +4394,10 @@ public Mono> setPropertiesNoCustomHeadersWithResponseAsync(String * 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 fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -4309,7 +4409,8 @@ public ResponseBase setPropertiesWithResponse( Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease, Context context) { + Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays, + Context context) { try { final String restype = "share"; final String comp = "properties"; @@ -4318,7 +4419,7 @@ public ResponseBase setPropertiesWithResponse( this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), shareProvisionedIops, shareProvisionedBandwidthMibps, - enableSmbDirectoryLease, accept, context); + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, accept, context); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } @@ -4352,6 +4453,10 @@ public ResponseBase setPropertiesWithResponse( * 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 fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -4360,11 +4465,12 @@ public ResponseBase setPropertiesWithResponse( public void setProperties(String shareName, Integer timeout, Integer quota, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, - Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease) { + Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, Boolean enableSmbDirectoryLease, + Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays) { setPropertiesWithResponse(shareName, timeout, quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, shareProvisionedIops, shareProvisionedBandwidthMibps, enableSmbDirectoryLease, - Context.NONE); + fileEnableChangeFeed, fileChangeFeedRetentionInDays, Context.NONE); } /** @@ -4395,6 +4501,10 @@ public void setProperties(String shareName, Integer timeout, Integer quota, Shar * 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 fileEnableChangeFeed Optional. Boolean. Default if not specified is false. This property enables change + * feed on the share. + * @param fileChangeFeedRetentionInDays Optional. Integer. Specifies the number of days that change feed records are + * retained, between 1 and 365. Default if not specified is 7 days. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws ShareStorageExceptionInternal thrown if the request is rejected by server. @@ -4406,7 +4516,8 @@ public Response setPropertiesNoCustomHeadersWithResponse(String shareName, ShareAccessTier accessTier, String leaseId, ShareRootSquash rootSquash, Boolean enableSnapshotVirtualDirectoryAccess, Boolean paidBurstingEnabled, Long paidBurstingMaxBandwidthMibps, Long paidBurstingMaxIops, Long shareProvisionedIops, Long shareProvisionedBandwidthMibps, - Boolean enableSmbDirectoryLease, Context context) { + Boolean enableSmbDirectoryLease, Boolean fileEnableChangeFeed, Integer fileChangeFeedRetentionInDays, + Context context) { try { final String restype = "share"; final String comp = "properties"; @@ -4415,7 +4526,7 @@ public Response setPropertiesNoCustomHeadersWithResponse(String shareName, this.client.getVersion(), quota, accessTier, leaseId, rootSquash, enableSnapshotVirtualDirectoryAccess, paidBurstingEnabled, paidBurstingMaxBandwidthMibps, paidBurstingMaxIops, this.client.getFileRequestIntent(), shareProvisionedIops, shareProvisionedBandwidthMibps, - enableSmbDirectoryLease, accept, context); + enableSmbDirectoryLease, fileEnableChangeFeed, fileChangeFeedRetentionInDays, accept, context); } catch (ShareStorageExceptionInternal internalException) { throw ModelHelper.mapToShareStorageException(internalException); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharesGetPropertiesHeaders.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharesGetPropertiesHeaders.java index 4596100989082..4f4f1021fd758 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharesGetPropertiesHeaders.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharesGetPropertiesHeaders.java @@ -196,6 +196,24 @@ public final class SharesGetPropertiesHeaders { @Generated private Boolean xMsEnableSmbDirectoryLease; + /* + * The x-ms-file-blob-container-for-xfiles-change-feed property. + */ + @Generated + private String xMsFileBlobContainerForXfilesChangeFeed; + + /* + * The x-ms-file-change-feed-retention-in-days property. + */ + @Generated + private Integer xMsFileChangeFeedRetentionInDays; + + /* + * The x-ms-file-enable-change-feed property. + */ + @Generated + private Boolean xMsFileEnableChangeFeed; + private static final HttpHeaderName X_MS_VERSION = HttpHeaderName.fromString("x-ms-version"); private static final HttpHeaderName X_MS_SHARE_QUOTA = HttpHeaderName.fromString("x-ms-share-quota"); @@ -260,6 +278,15 @@ public final class SharesGetPropertiesHeaders { private static final HttpHeaderName X_MS_ENABLE_SMB_DIRECTORY_LEASE = HttpHeaderName.fromString("x-ms-enable-smb-directory-lease"); + private static final HttpHeaderName X_MS_FILE_BLOB_CONTAINER_FOR_XFILES_CHANGE_FEED + = HttpHeaderName.fromString("x-ms-file-blob-container-for-xfiles-change-feed"); + + private static final HttpHeaderName X_MS_FILE_CHANGE_FEED_RETENTION_IN_DAYS + = HttpHeaderName.fromString("x-ms-file-change-feed-retention-in-days"); + + private static final HttpHeaderName X_MS_FILE_ENABLE_CHANGE_FEED + = HttpHeaderName.fromString("x-ms-file-enable-change-feed"); + // HttpHeaders containing the raw property values. /** * Creates an instance of SharesGetPropertiesHeaders class. @@ -413,6 +440,20 @@ public SharesGetPropertiesHeaders(HttpHeaders rawHeaders) { } else { this.xMsEnableSmbDirectoryLease = null; } + this.xMsFileBlobContainerForXfilesChangeFeed + = rawHeaders.getValue(X_MS_FILE_BLOB_CONTAINER_FOR_XFILES_CHANGE_FEED); + String xMsFileChangeFeedRetentionInDays = rawHeaders.getValue(X_MS_FILE_CHANGE_FEED_RETENTION_IN_DAYS); + if (xMsFileChangeFeedRetentionInDays != null) { + this.xMsFileChangeFeedRetentionInDays = Integer.parseInt(xMsFileChangeFeedRetentionInDays); + } else { + this.xMsFileChangeFeedRetentionInDays = null; + } + String xMsFileEnableChangeFeed = rawHeaders.getValue(X_MS_FILE_ENABLE_CHANGE_FEED); + if (xMsFileEnableChangeFeed != null) { + this.xMsFileEnableChangeFeed = Boolean.parseBoolean(xMsFileEnableChangeFeed); + } else { + this.xMsFileEnableChangeFeed = null; + } Map xMsMetaHeaderCollection = new LinkedHashMap<>(); rawHeaders.stream().forEach(header -> { @@ -1122,4 +1163,73 @@ public SharesGetPropertiesHeaders setXMsEnableSmbDirectoryLease(Boolean xMsEnabl this.xMsEnableSmbDirectoryLease = xMsEnableSmbDirectoryLease; return this; } + + /** + * Get the xMsFileBlobContainerForXfilesChangeFeed property: The x-ms-file-blob-container-for-xfiles-change-feed + * property. + * + * @return the xMsFileBlobContainerForXfilesChangeFeed value. + */ + @Generated + public String getXMsFileBlobContainerForXfilesChangeFeed() { + return this.xMsFileBlobContainerForXfilesChangeFeed; + } + + /** + * Set the xMsFileBlobContainerForXfilesChangeFeed property: The x-ms-file-blob-container-for-xfiles-change-feed + * property. + * + * @param xMsFileBlobContainerForXfilesChangeFeed the xMsFileBlobContainerForXfilesChangeFeed value to set. + * @return the SharesGetPropertiesHeaders object itself. + */ + @Generated + public SharesGetPropertiesHeaders + setXMsFileBlobContainerForXfilesChangeFeed(String xMsFileBlobContainerForXfilesChangeFeed) { + this.xMsFileBlobContainerForXfilesChangeFeed = xMsFileBlobContainerForXfilesChangeFeed; + return this; + } + + /** + * Get the xMsFileChangeFeedRetentionInDays property: The x-ms-file-change-feed-retention-in-days property. + * + * @return the xMsFileChangeFeedRetentionInDays value. + */ + @Generated + public Integer getXMsFileChangeFeedRetentionInDays() { + return this.xMsFileChangeFeedRetentionInDays; + } + + /** + * Set the xMsFileChangeFeedRetentionInDays property: The x-ms-file-change-feed-retention-in-days property. + * + * @param xMsFileChangeFeedRetentionInDays the xMsFileChangeFeedRetentionInDays value to set. + * @return the SharesGetPropertiesHeaders object itself. + */ + @Generated + public SharesGetPropertiesHeaders setXMsFileChangeFeedRetentionInDays(Integer xMsFileChangeFeedRetentionInDays) { + this.xMsFileChangeFeedRetentionInDays = xMsFileChangeFeedRetentionInDays; + return this; + } + + /** + * Get the xMsFileEnableChangeFeed property: The x-ms-file-enable-change-feed property. + * + * @return the xMsFileEnableChangeFeed value. + */ + @Generated + public Boolean isXMsFileEnableChangeFeed() { + return this.xMsFileEnableChangeFeed; + } + + /** + * Set the xMsFileEnableChangeFeed property: The x-ms-file-enable-change-feed property. + * + * @param xMsFileEnableChangeFeed the xMsFileEnableChangeFeed value to set. + * @return the SharesGetPropertiesHeaders object itself. + */ + @Generated + public SharesGetPropertiesHeaders setXMsFileEnableChangeFeed(Boolean xMsFileEnableChangeFeed) { + this.xMsFileEnableChangeFeed = xMsFileEnableChangeFeed; + return this; + } } diff --git a/sdk/storage/azure-storage-file-share/swagger/README.md b/sdk/storage/azure-storage-file-share/swagger/README.md index 223d605db8f0d..4c14ea6be8497 100644 --- a/sdk/storage/azure-storage-file-share/swagger/README.md +++ b/sdk/storage/azure-storage-file-share/swagger/README.md @@ -16,7 +16,7 @@ autorest ### Code generation settings ``` yaml use: '@autorest/java@4.1.63' -input-file: https://raw.githubusercontent.com/seanmcc-msft/azure-rest-api-specs/e38b4c39072e9c00e3607cde729cea2e8d237b92/specification/storage/data-plane/Microsoft.FileStorage/stable/2026-12-06/file.json +input-file: https://raw.githubusercontent.com/browndav-msft/azure-rest-api-specs/c33e50e60eee823f5310fbc2ddd3f20ab724924b/specification/storage/data-plane/Microsoft.FileStorage/stable/2027-03-07/file.json java: true output-folder: ../ namespace: com.azure.storage.file.share From aab0fd08009629551b64b117f1b4cd15f408cd82 Mon Sep 17 00:00:00 2001 From: browndav Date: Fri, 2 Oct 2026 18:48:30 -0400 Subject: [PATCH 03/13] wire up clients, options, and responses --- .../storage/file/share/ShareAsyncClient.java | 6 +- .../azure/storage/file/share/ShareClient.java | 4 +- .../implementation/util/ModelHelper.java | 5 +- .../file/share/models/ShareProperties.java | 81 +++++++++++++++++++ .../share/options/ShareCreateOptions.java | 48 +++++++++++ .../options/ShareSetPropertiesOptions.java | 49 +++++++++++ 6 files changed, 188 insertions(+), 5 deletions(-) diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java index 4f9c29bc7d9ca..2e9e665bfa99e 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java @@ -371,7 +371,9 @@ Mono> createWithResponse(ShareCreateOptions options, Context options.getAccessTier(), enabledProtocol, options.getRootSquash(), options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(), options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), - options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, context) + options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, + options.isChangeFeedEnabled(), options.getChangeFeedRetentionInDays(), + context) .map(ModelHelper::mapToShareInfoResponse); } @@ -940,7 +942,7 @@ Mono> setPropertiesWithResponse(ShareSetPropertiesOptions op options.getAccessTier(), requestConditions.getLeaseId(), options.getRootSquash(), options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(), options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), - options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, context) + options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, options.isChangeFeedEnabled(), options.getChangeFeedRetentionInDays(), context) .map(ModelHelper::mapToShareInfoResponse); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java index 5eddfa88edf7b..c77235de253db 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java @@ -369,7 +369,7 @@ public Response createWithResponse(ShareCreateOptions options, Durati finalOptions.isSnapshotVirtualDirectoryAccessEnabled(), finalOptions.isPaidBurstingEnabled(), finalOptions.getPaidBurstingMaxBandwidthMibps(), finalOptions.getPaidBurstingMaxIops(), finalOptions.getProvisionedMaxIops(), finalOptions.getProvisionedMaxBandwidthMibps(), null, - finalContext); + finalOptions.isChangeFeedEnabled() , finalOptions.getChangeFeedRetentionInDays(), finalContext); return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -899,7 +899,7 @@ public Response setPropertiesWithResponse(ShareSetPropertiesOptions o requestConditions.getLeaseId(), options.getRootSquash(), options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(), options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), - options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, finalContext); + options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, options.isChangeFeedEnabled(), options.getChangeFeedRetentionInDays(), finalContext); return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java index dd398752a1cd0..a6fbc89aca859 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java @@ -536,7 +536,10 @@ public static Response mapToShareInfoResponse(Response response) { .setMaxBurstCreditsForIops(headers.getXMsShareMaxBurstCreditsForIops()) .setNextAllowedProvisionedIopsDowngradeTime(headers.getXMsShareNextAllowedProvisionedIopsDowngradeTime()) .setNextAllowedProvisionedBandwidthDowngradeTime( - headers.getXMsShareNextAllowedProvisionedBandwidthDowngradeTime()); + headers.getXMsShareNextAllowedProvisionedBandwidthDowngradeTime()) + .setChangeFeedEnabled(headers.isXMsFileEnableChangeFeed()) + .setChangeFeedBlobContainerName(headers.getXMsFileBlobContainerForXfilesChangeFeed()) + .setChangeFeedRetentionInDays(headers.getXMsFileChangeFeedRetentionInDays()); return new SimpleResponse<>(response, shareProperties); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java index 9293d4e89baee..86206a13b7665 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java @@ -168,6 +168,25 @@ public final class ShareProperties implements XmlSerializable { */ private Boolean enableSmbDirectoryLease; + /* + * Optional. Supported in version 2026-02-01 and above. + * Specifies whether change feed is enabled on the share. + */ + private boolean enableChangeFeed; + + /* + * Optional. Supported in version 2026-02-01 and above. + * The number of days that change feed reocrds are retrained on the share. Valid values are between 1 and 365 + * inclusive. Default if not specified is 7 days. + */ + private int changeFeedRetentionInDays; + + /* + * Optional. Supported in version 2026-02-01 and above. The name of the blob container where teh change feed + * records are stored. The name of the blob container is in the format "$fileschangefeed-". + */ + private String changeFeedBlobContainerName; + /** * Creates a new instance of {@link ShareProperties}. */ @@ -826,6 +845,68 @@ public ShareProperties setSmbDirectoryLeaseEnabled(Boolean enableSmbDirectoryLea return this; } + /** + * Optional. Supported in version 2026-02-01 and above. + * Specifies whether change feed is enabled on the share. + * @return the enableChangeFeed value. + */ + public boolean isChangeFeedEnabled() { + return enableChangeFeed; + } + + /** + * Optional. Supported in version 2026-02-01 and above. + * Specifies whether change feed is enabled on the share. + * @param enableChangeFeed the enableChangeFeed value to set. + * @return the ShareProperties object itself. + */ + public ShareProperties setChangeFeedEnabled(boolean enableChangeFeed) { + this.enableChangeFeed = enableChangeFeed; + return this; + } + + /** + * Optional. Supported in version 2026-02-01 and above. + * The number of days that change feed records are retained on the share. Valid values are between 1 and 365 + * inclusive. Default if not specified is 7 days. + * @return the changeFeedRetentionInDays value. + */ + public int getChangeFeedRetentionInDays() { + return changeFeedRetentionInDays; + } + + /** + * Optional. Supported in version 2026-02-01 and above. + * The number of days that change feed records are retained on the share. Valid values are between 1 and 365 + * inclusive. Default if not specified is 7 days. + * @param changeFeedRetentionInDays the changeFeedRetentionInDays value to set. + * @return the ShareProperties object itself. + */ + public ShareProperties setChangeFeedRetentionInDays(int changeFeedRetentionInDays) { + this.changeFeedRetentionInDays = changeFeedRetentionInDays; + return this; + } + + /** + * Optional. Supported in version 2026-02-01 and above. The name of the blob container where the change feed + * records are stored. The name of the blob container is in the format "$fileschangefeed-". + * @return the blobContainerForChangeFeed value. + */ + public String getChangeFeedBlobContainerName() { + return changeFeedBlobContainerName; + } + + /** + * Optional. Supported in version 2026-02-01 and above. The name of the blob container where the change feed + * records are stored. The name of the blob container is in the format "$fileschangefeed-". + * @param changeFeedBlobContainerName the blobContainerForChangeFeed value to set. + * @return the ShareProperties object itself. + */ + public ShareProperties setChangeFeedBlobContainerName(String changeFeedBlobContainerName) { + this.changeFeedBlobContainerName = changeFeedBlobContainerName; + return this; + } + @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { return toXml(xmlWriter, null); diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java index 8c07e9870bd08..0546a0b21518c 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java @@ -26,6 +26,8 @@ public class ShareCreateOptions { private Long paidBurstingMaxBandwidthMibps; private Long provisionedMaxIops; private Long provisionedMaxBandwidthMibps; + private Boolean enableChangeFeed; + private Integer changeFeedRetentionInDays; /** * Creates a new instance of {@link ShareCreateOptions}. @@ -277,4 +279,50 @@ public ShareCreateOptions setProvisionedMaxBandwidthMibps(Long provisionedMaxBan this.provisionedMaxBandwidthMibps = provisionedMaxBandwidthMibps; return this; } + + /** + * Get the enableChangeFeed property: + * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. + * This property enables change feed on the share. + * @return the enableChangeFeed value. + */ + public Boolean isChangeFeedEnabled() { + return enableChangeFeed; + } + + /** + * Set the enableChangeFeed property: + * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. + * This property enables change feed on the share. + * @param enableChangeFeed the enableChangeFeed value to set. + * @return the ShareCreateOptions object itself. + */ + public ShareCreateOptions setChangeFeedEnabled(Boolean enableChangeFeed) { + this.enableChangeFeed = enableChangeFeed; + return this; + } + + + + /** + * Get the changeFeedRetentionInDays property: + * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. + * The number of days that change feed records are retained. + * @return the changeFeedRetentionInDays value. + */ + public Integer getChangeFeedRetentionInDays() { + return changeFeedRetentionInDays; + } + + /** + * Set the changeFeedRetentionInDays property: + * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. + * The number of days that change feed records are retained. + * @param changeFeedRetentionInDays the changeFeedRetentionInDays value to set. + * @return the ShareCreateOptions object itself. + */ + public ShareCreateOptions setChangeFeedRetentionInDays(Integer changeFeedRetentionInDays) { + this.changeFeedRetentionInDays = changeFeedRetentionInDays; + return this; + } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java index 1e398ee52872d..cca139960cc4c 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java @@ -23,6 +23,9 @@ public class ShareSetPropertiesOptions { private Long paidBurstingMaxBandwidthMibps; private Long provisionedMaxIops; private Long provisionedMaxBandwidthMibps; + private Boolean enableChangeFeed; + private Integer changeFeedRetentionInDays; + /** * Creates a new instance of {@link ShareSetPropertiesOptions}. @@ -256,4 +259,50 @@ public ShareSetPropertiesOptions setProvisionedMaxBandwidthMibps(Long provisione this.provisionedMaxBandwidthMibps = provisionedMaxBandwidthMibps; return this; } + + + /** + * Get the enableChangeFeed property: + * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. + * This property enables change feed on the share. + * @return the enableChangeFeed value. + */ + public Boolean isChangeFeedEnabled() { + return enableChangeFeed; + } + + /** + * Set the enableChangeFeed property: + * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. + * This property enables change feed on the share. + * @param enableChangeFeed the enableChangeFeed value to set. + * @return the ShareSetPropertiesOptions object itself. + */ + public ShareSetPropertiesOptions setChangeFeedEnabled(Boolean enableChangeFeed) { + this.enableChangeFeed = enableChangeFeed; + return this; + } + + /** + * Get the changeFeedRetentionInDays property: + * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. + * The number of days that change feed records are retained. + * @return the changeFeedRetentionInDays value. + */ + public Integer getChangeFeedRetentionInDays() { + return changeFeedRetentionInDays; + } + + /** + * Set the changeFeedRetentionInDays property: + * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. + * The number of days that change feed records are retained. + * @param changeFeedRetentionInDays the changeFeedRetentionInDays value to set. + * @return the ShareSetPropertiesOptions object itself. + */ + public ShareSetPropertiesOptions setChangeFeedRetentionInDays(Integer changeFeedRetentionInDays) { + this.changeFeedRetentionInDays = changeFeedRetentionInDays; + return this; + } + } From dcfda95755d88efca2dda961f4e75d97e1caef05 Mon Sep 17 00:00:00 2001 From: browndav Date: Fri, 2 Oct 2026 18:49:22 -0400 Subject: [PATCH 04/13] spotless apply --- .../java/com/azure/storage/file/share/ShareAsyncClient.java | 6 +++--- .../main/java/com/azure/storage/file/share/ShareClient.java | 5 +++-- .../storage/file/share/options/ShareCreateOptions.java | 2 -- .../file/share/options/ShareSetPropertiesOptions.java | 2 -- 4 files changed, 6 insertions(+), 9 deletions(-) diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java index 2e9e665bfa99e..1900beac97b1b 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java @@ -372,8 +372,7 @@ Mono> createWithResponse(ShareCreateOptions options, Context options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(), options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, - options.isChangeFeedEnabled(), options.getChangeFeedRetentionInDays(), - context) + options.isChangeFeedEnabled(), options.getChangeFeedRetentionInDays(), context) .map(ModelHelper::mapToShareInfoResponse); } @@ -942,7 +941,8 @@ Mono> setPropertiesWithResponse(ShareSetPropertiesOptions op options.getAccessTier(), requestConditions.getLeaseId(), options.getRootSquash(), options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(), options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), - options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, options.isChangeFeedEnabled(), options.getChangeFeedRetentionInDays(), context) + options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, + options.isChangeFeedEnabled(), options.getChangeFeedRetentionInDays(), context) .map(ModelHelper::mapToShareInfoResponse); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java index c77235de253db..ad7b672c3d7b5 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareClient.java @@ -369,7 +369,7 @@ public Response createWithResponse(ShareCreateOptions options, Durati finalOptions.isSnapshotVirtualDirectoryAccessEnabled(), finalOptions.isPaidBurstingEnabled(), finalOptions.getPaidBurstingMaxBandwidthMibps(), finalOptions.getPaidBurstingMaxIops(), finalOptions.getProvisionedMaxIops(), finalOptions.getProvisionedMaxBandwidthMibps(), null, - finalOptions.isChangeFeedEnabled() , finalOptions.getChangeFeedRetentionInDays(), finalContext); + finalOptions.isChangeFeedEnabled(), finalOptions.getChangeFeedRetentionInDays(), finalContext); return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } @@ -899,7 +899,8 @@ public Response setPropertiesWithResponse(ShareSetPropertiesOptions o requestConditions.getLeaseId(), options.getRootSquash(), options.isSnapshotVirtualDirectoryAccessEnabled(), options.isPaidBurstingEnabled(), options.getPaidBurstingMaxBandwidthMibps(), options.getPaidBurstingMaxIops(), - options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, options.isChangeFeedEnabled(), options.getChangeFeedRetentionInDays(), finalContext); + options.getProvisionedMaxIops(), options.getProvisionedMaxBandwidthMibps(), null, + options.isChangeFeedEnabled(), options.getChangeFeedRetentionInDays(), finalContext); return ModelHelper.mapToShareInfoResponse(sendRequest(operation, timeout, ShareStorageException.class)); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java index 0546a0b21518c..2f4d014c58b82 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java @@ -302,8 +302,6 @@ public ShareCreateOptions setChangeFeedEnabled(Boolean enableChangeFeed) { return this; } - - /** * Get the changeFeedRetentionInDays property: * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java index cca139960cc4c..57a8a30eb9e69 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java @@ -26,7 +26,6 @@ public class ShareSetPropertiesOptions { private Boolean enableChangeFeed; private Integer changeFeedRetentionInDays; - /** * Creates a new instance of {@link ShareSetPropertiesOptions}. */ @@ -260,7 +259,6 @@ public ShareSetPropertiesOptions setProvisionedMaxBandwidthMibps(Long provisione return this; } - /** * Get the enableChangeFeed property: * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. From 511d60971226acd22b29046d92abc3a8d9bd7c4a Mon Sep 17 00:00:00 2001 From: browndav Date: Mon, 5 Oct 2026 12:12:39 -0400 Subject: [PATCH 05/13] change primitives to wrapped reference types --- .../file/share/models/ShareProperties.java | 26 ++++++------- .../azure/storage/file/share/ModelTests.java | 38 +++++++++++++++++++ 2 files changed, 51 insertions(+), 13 deletions(-) diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java index 86206a13b7665..fb7203a1b0e99 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java @@ -172,18 +172,18 @@ public final class ShareProperties implements XmlSerializable { * Optional. Supported in version 2026-02-01 and above. * Specifies whether change feed is enabled on the share. */ - private boolean enableChangeFeed; + private Boolean enableChangeFeed; /* * Optional. Supported in version 2026-02-01 and above. * The number of days that change feed reocrds are retrained on the share. Valid values are between 1 and 365 * inclusive. Default if not specified is 7 days. */ - private int changeFeedRetentionInDays; + private Integer changeFeedRetentionInDays; /* * Optional. Supported in version 2026-02-01 and above. The name of the blob container where teh change feed - * records are stored. The name of the blob container is in the format "$fileschangefeed-". + * records are stored. The name of the blob container is in the format {@code $fileschangefeed-}. */ private String changeFeedBlobContainerName; @@ -848,19 +848,19 @@ public ShareProperties setSmbDirectoryLeaseEnabled(Boolean enableSmbDirectoryLea /** * Optional. Supported in version 2026-02-01 and above. * Specifies whether change feed is enabled on the share. - * @return the enableChangeFeed value. + * @return the enableChangeFeed value, or {@code null} if not returned by the service. */ - public boolean isChangeFeedEnabled() { + public Boolean isChangeFeedEnabled() { return enableChangeFeed; } /** * Optional. Supported in version 2026-02-01 and above. * Specifies whether change feed is enabled on the share. - * @param enableChangeFeed the enableChangeFeed value to set. + * @param enableChangeFeed the enableChangeFeed value to set, or {@code null} if unavailable. * @return the ShareProperties object itself. */ - public ShareProperties setChangeFeedEnabled(boolean enableChangeFeed) { + public ShareProperties setChangeFeedEnabled(Boolean enableChangeFeed) { this.enableChangeFeed = enableChangeFeed; return this; } @@ -869,9 +869,9 @@ public ShareProperties setChangeFeedEnabled(boolean enableChangeFeed) { * Optional. Supported in version 2026-02-01 and above. * The number of days that change feed records are retained on the share. Valid values are between 1 and 365 * inclusive. Default if not specified is 7 days. - * @return the changeFeedRetentionInDays value. + * @return the changeFeedRetentionInDays value, or {@code null} if not returned by the service. */ - public int getChangeFeedRetentionInDays() { + public Integer getChangeFeedRetentionInDays() { return changeFeedRetentionInDays; } @@ -879,17 +879,17 @@ public int getChangeFeedRetentionInDays() { * Optional. Supported in version 2026-02-01 and above. * The number of days that change feed records are retained on the share. Valid values are between 1 and 365 * inclusive. Default if not specified is 7 days. - * @param changeFeedRetentionInDays the changeFeedRetentionInDays value to set. + * @param changeFeedRetentionInDays the changeFeedRetentionInDays value to set, or {@code null} if unavailable. * @return the ShareProperties object itself. */ - public ShareProperties setChangeFeedRetentionInDays(int changeFeedRetentionInDays) { + public ShareProperties setChangeFeedRetentionInDays(Integer changeFeedRetentionInDays) { this.changeFeedRetentionInDays = changeFeedRetentionInDays; return this; } /** * Optional. Supported in version 2026-02-01 and above. The name of the blob container where the change feed - * records are stored. The name of the blob container is in the format "$fileschangefeed-". + * records are stored. The name of the blob container is in the format {@code $fileschangefeed-}. * @return the blobContainerForChangeFeed value. */ public String getChangeFeedBlobContainerName() { @@ -898,7 +898,7 @@ public String getChangeFeedBlobContainerName() { /** * Optional. Supported in version 2026-02-01 and above. The name of the blob container where the change feed - * records are stored. The name of the blob container is in the format "$fileschangefeed-". + * records are stored. The name of the blob container is in the format {@code $fileschangefeed-}. * @param changeFeedBlobContainerName the blobContainerForChangeFeed value to set. * @return the ShareProperties object itself. */ diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ModelTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ModelTests.java index b29c9b05f1176..0f2e8303504d2 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ModelTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ModelTests.java @@ -3,9 +3,18 @@ package com.azure.storage.file.share; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.HttpMethod; +import com.azure.core.http.HttpRequest; +import com.azure.core.http.rest.ResponseBase; +import com.azure.storage.file.share.implementation.models.SharesGetPropertiesHeaders; +import com.azure.storage.file.share.implementation.util.ModelHelper; import com.azure.storage.file.share.models.NtfsFileAttributes; import com.azure.storage.file.share.models.ShareFileUploadRangeOptions; +import com.azure.storage.file.share.models.ShareProperties; import org.junit.jupiter.api.Test; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.CsvSource; import java.io.ByteArrayInputStream; import java.util.EnumSet; @@ -16,6 +25,35 @@ public class ModelTests { + @Test + void sharePropertiesChangeFeedDefaultsAndClearing() { + ShareProperties properties = new ShareProperties(); + assertNull(properties.isChangeFeedEnabled()); + assertNull(properties.getChangeFeedRetentionInDays()); + + properties.setChangeFeedEnabled(true).setChangeFeedRetentionInDays(7); + properties.setChangeFeedEnabled(null).setChangeFeedRetentionInDays(null); + assertNull(properties.isChangeFeedEnabled()); + assertNull(properties.getChangeFeedRetentionInDays()); + } + + @ParameterizedTest + @CsvSource(value = { "null,null", "true,7", "false,1", "null,7", "false,null" }, nullValues = "null") + void mapSharePropertiesChangeFeed(Boolean enabled, Integer retentionInDays) { + HttpHeaders rawHeaders = new HttpHeaders(); + SharesGetPropertiesHeaders headers = new SharesGetPropertiesHeaders(rawHeaders).setXMsShareQuota(1) + .setXMsFileEnableChangeFeed(enabled) + .setXMsFileChangeFeedRetentionInDays(retentionInDays); + ResponseBase response + = new ResponseBase<>(new HttpRequest(HttpMethod.GET, "https://account.file.core.windows.net/share"), 200, + rawHeaders, null, headers); + + ShareProperties properties = ModelHelper.mapGetPropertiesResponse(response).getValue(); + + assertEquals(enabled, properties.isChangeFeedEnabled()); + assertEquals(retentionInDays, properties.getChangeFeedRetentionInDays()); + } + @Test void ntfsToAttributes() { assertEquals(EnumSet.of(NtfsFileAttributes.READ_ONLY), NtfsFileAttributes.toAttributes("ReadOnly")); From f25977faaf5a0689ad6c12e7a05351e307a63aa1 Mon Sep 17 00:00:00 2001 From: browndav Date: Mon, 5 Oct 2026 13:06:26 -0400 Subject: [PATCH 06/13] fix spelling issues --- .../com/azure/storage/file/share/models/ShareProperties.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java index fb7203a1b0e99..4fb7bc7c83fd3 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java @@ -176,13 +176,13 @@ public final class ShareProperties implements XmlSerializable { /* * Optional. Supported in version 2026-02-01 and above. - * The number of days that change feed reocrds are retrained on the share. Valid values are between 1 and 365 + * The number of days that change feed records are retained on the share. Valid values are between 1 and 365 * inclusive. Default if not specified is 7 days. */ private Integer changeFeedRetentionInDays; /* - * Optional. Supported in version 2026-02-01 and above. The name of the blob container where teh change feed + * Optional. Supported in version 2026-02-01 and above. The name of the blob container where the change feed * records are stored. The name of the blob container is in the format {@code $fileschangefeed-}. */ private String changeFeedBlobContainerName; From 6c21c9d97bd1609c78a2cded060886b463ef7b21 Mon Sep 17 00:00:00 2001 From: browndav Date: Tue, 6 Oct 2026 18:21:21 -0400 Subject: [PATCH 07/13] remove model tests, add live tests, push assets --- .../azure-storage-file-share/assets.json | 2 +- .../file/share/FileShareTestHelper.java | 56 +++++++++++++++++++ .../azure/storage/file/share/ModelTests.java | 25 --------- .../storage/file/share/ShareApiTests.java | 41 ++++++++++++++ .../file/share/ShareAsyncApiTests.java | 45 +++++++++++++++ 5 files changed, 143 insertions(+), 26 deletions(-) diff --git a/sdk/storage/azure-storage-file-share/assets.json b/sdk/storage/azure-storage-file-share/assets.json index 92a17c9561e63..963e15ca57fb3 100644 --- a/sdk/storage/azure-storage-file-share/assets.json +++ b/sdk/storage/azure-storage-file-share/assets.json @@ -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_679d0d8151" + "Tag": "java/storage/azure-storage-file-share_3b79986467" } diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileShareTestHelper.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileShareTestHelper.java index bd329ede2ed54..c27d9a68a1812 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileShareTestHelper.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileShareTestHelper.java @@ -3,6 +3,8 @@ package com.azure.storage.file.share; +import com.azure.core.http.HttpHeaderName; +import com.azure.core.http.HttpHeaders; import com.azure.core.http.rest.Response; import com.azure.core.util.logging.ClientLogger; import com.azure.storage.common.implementation.Constants; @@ -18,6 +20,7 @@ import com.azure.storage.file.share.models.ShareFileRangeItem; import com.azure.storage.file.share.models.ShareItem; import com.azure.storage.file.share.models.ShareMetrics; +import com.azure.storage.file.share.models.ShareProperties; import com.azure.storage.file.share.models.ShareRetentionPolicy; import com.azure.storage.file.share.models.ShareRootSquash; import com.azure.storage.file.share.models.ShareServiceProperties; @@ -47,11 +50,18 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertNull; import static org.junit.jupiter.api.Assertions.assertTrue; public class FileShareTestHelper { private static final ClientLogger LOGGER = new ClientLogger(FileShareTestHelper.class); + private static final HttpHeaderName X_MS_FILE_ENABLE_CHANGE_FEED + = HttpHeaderName.fromString("x-ms-file-enable-change-feed"); + private static final HttpHeaderName X_MS_FILE_CHANGE_FEED_RETENTION_IN_DAYS + = HttpHeaderName.fromString("x-ms-file-change-feed-retention-in-days"); + private static final HttpHeaderName X_MS_FILE_BLOB_CONTAINER_FOR_XFILES_CHANGE_FEED + = HttpHeaderName.fromString("x-ms-file-blob-container-for-xfiles-change-feed"); static String getRandomString(int size) { byte[] array = new byte[size]; @@ -72,6 +82,52 @@ protected static Response assertResponseStatusCode(Response response, return response; } + static Stream createShareChangeFeedSupplier() { + return Stream.of(Arguments.of(true, 7), Arguments.of(true, null), Arguments.of(false, null), + Arguments.of(null, null)); + } + + static Stream setPropertiesShareChangeFeedSupplier() { + return Stream.of(Arguments.of(true, 14), Arguments.of(true, null), Arguments.of(false, null), + Arguments.of(null, 14), Arguments.of(null, null)); + } + + static void assertShareChangeFeedRequestHeaders(Response response, Boolean enabled, Integer retentionInDays) { + HttpHeaders headers = response.getRequest().getHeaders(); + assertEquals(enabled == null ? null : enabled.toString(), headers.getValue(X_MS_FILE_ENABLE_CHANGE_FEED)); + assertEquals(retentionInDays == null ? null : retentionInDays.toString(), + headers.getValue(X_MS_FILE_CHANGE_FEED_RETENTION_IN_DAYS)); + } + + static void assertShareChangeFeedProperties(Response response, Boolean enabled, + Integer retentionInDays) { + assertEquals(200, response.getStatusCode()); + HttpHeaders headers = response.getHeaders(); + ShareProperties properties = response.getValue(); + String enabledHeader = headers.getValue(X_MS_FILE_ENABLE_CHANGE_FEED); + String retentionHeader = headers.getValue(X_MS_FILE_CHANGE_FEED_RETENTION_IN_DAYS); + String containerHeader = headers.getValue(X_MS_FILE_BLOB_CONTAINER_FOR_XFILES_CHANGE_FEED); + + // Omitted options may be defaulted by the service; their raw headers must still map to the public properties. + assertEquals(enabledHeader == null ? null : Boolean.valueOf(enabledHeader), properties.isChangeFeedEnabled()); + assertEquals(retentionHeader == null ? null : Integer.valueOf(retentionHeader), + properties.getChangeFeedRetentionInDays()); + assertEquals(containerHeader, properties.getChangeFeedBlobContainerName()); + if (enabled != null) { + assertNotNull(enabledHeader); + assertEquals(enabled, Boolean.valueOf(enabledHeader)); + assertEquals(enabled, properties.isChangeFeedEnabled()); + } + if (retentionInDays != null) { + assertEquals(retentionInDays.toString(), retentionHeader); + assertEquals(retentionInDays, properties.getChangeFeedRetentionInDays()); + } + if (Boolean.TRUE.equals(enabled)) { + assertNotNull(containerHeader); + assertFalse(containerHeader.isEmpty()); + } + } + /** * Compares the two timestamps to the minute * @param expectedTime expected time diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ModelTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ModelTests.java index 0f2e8303504d2..ba9109e04b823 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ModelTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ModelTests.java @@ -3,18 +3,10 @@ package com.azure.storage.file.share; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpMethod; -import com.azure.core.http.HttpRequest; -import com.azure.core.http.rest.ResponseBase; -import com.azure.storage.file.share.implementation.models.SharesGetPropertiesHeaders; -import com.azure.storage.file.share.implementation.util.ModelHelper; import com.azure.storage.file.share.models.NtfsFileAttributes; import com.azure.storage.file.share.models.ShareFileUploadRangeOptions; import com.azure.storage.file.share.models.ShareProperties; import org.junit.jupiter.api.Test; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.CsvSource; import java.io.ByteArrayInputStream; import java.util.EnumSet; @@ -37,23 +29,6 @@ void sharePropertiesChangeFeedDefaultsAndClearing() { assertNull(properties.getChangeFeedRetentionInDays()); } - @ParameterizedTest - @CsvSource(value = { "null,null", "true,7", "false,1", "null,7", "false,null" }, nullValues = "null") - void mapSharePropertiesChangeFeed(Boolean enabled, Integer retentionInDays) { - HttpHeaders rawHeaders = new HttpHeaders(); - SharesGetPropertiesHeaders headers = new SharesGetPropertiesHeaders(rawHeaders).setXMsShareQuota(1) - .setXMsFileEnableChangeFeed(enabled) - .setXMsFileChangeFeedRetentionInDays(retentionInDays); - ResponseBase response - = new ResponseBase<>(new HttpRequest(HttpMethod.GET, "https://account.file.core.windows.net/share"), 200, - rawHeaders, null, headers); - - ShareProperties properties = ModelHelper.mapGetPropertiesResponse(response).getValue(); - - assertEquals(enabled, properties.isChangeFeedEnabled()); - assertEquals(retentionInDays, properties.getChangeFeedRetentionInDays()); - } - @Test void ntfsToAttributes() { assertEquals(EnumSet.of(NtfsFileAttributes.READ_ONLY), NtfsFileAttributes.toAttributes("ReadOnly")); diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java index fc0b3b5ce8161..39a3aad391bbf 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java @@ -1524,6 +1524,47 @@ public void setPropertiesSharePaidBursting() { premiumFileServiceClient.getShareClient(shareName).delete(); } + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2027-03-07") + @ParameterizedTest + @MethodSource("com.azure.storage.file.share.FileShareTestHelper#createShareChangeFeedSupplier") + public void createShareChangeFeed(Boolean enabled, Integer retentionInDays) { + ShareClient client = premiumFileServiceClient.getShareClient(shareName); + ShareCreateOptions options + = new ShareCreateOptions().setChangeFeedEnabled(enabled).setChangeFeedRetentionInDays(retentionInDays); + + Response response = client.createWithResponse(options, null, null); + try { + assertEquals(201, response.getStatusCode()); + FileShareTestHelper.assertShareChangeFeedRequestHeaders(response, enabled, retentionInDays); + FileShareTestHelper.assertShareChangeFeedProperties(client.getPropertiesWithResponse(null, null), + enabled, retentionInDays); + } finally { + client.delete(); + } + } + + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2027-03-07") + @ParameterizedTest + @MethodSource("com.azure.storage.file.share.FileShareTestHelper#setPropertiesShareChangeFeedSupplier") + public void setPropertiesShareChangeFeed(Boolean enabled, Integer retentionInDays) { + ShareClient client = premiumFileServiceClient.getShareClient(shareName); + client.createWithResponse(new ShareCreateOptions().setChangeFeedEnabled(true).setChangeFeedRetentionInDays(7), + null, null); + try { + ShareSetPropertiesOptions options = new ShareSetPropertiesOptions().setChangeFeedEnabled(enabled) + .setChangeFeedRetentionInDays(retentionInDays); + Response response = client.setPropertiesWithResponse(options, null, null); + assertEquals(200, response.getStatusCode()); + FileShareTestHelper.assertShareChangeFeedRequestHeaders(response, enabled, retentionInDays); + FileShareTestHelper.assertShareChangeFeedProperties(client.getPropertiesWithResponse(null, null), + enabled == null ? true : enabled, + Boolean.FALSE.equals(enabled) ? retentionInDays + : retentionInDays == null ? Integer.valueOf(7) : retentionInDays); + } finally { + client.delete(); + } + } + @PlaybackOnly @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2025-01-05") @Test diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java index 188797c2bba17..af2a0659f5c4b 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java @@ -1159,6 +1159,51 @@ public void setPropertiesSharePaidBursting() { premiumFileServiceAsyncClient.getShareAsyncClient(shareName).delete().block(); } + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2027-03-07") + @ParameterizedTest + @MethodSource("com.azure.storage.file.share.FileShareTestHelper#createShareChangeFeedSupplier") + public void createShareChangeFeed(Boolean enabled, Integer retentionInDays) { + ShareAsyncClient client = premiumFileServiceAsyncClient.getShareAsyncClient(shareName); + ShareCreateOptions options + = new ShareCreateOptions().setChangeFeedEnabled(enabled).setChangeFeedRetentionInDays(retentionInDays); + + Response response = client.createWithResponse(options).block(); + try { + assertEquals(201, response.getStatusCode()); + FileShareTestHelper.assertShareChangeFeedRequestHeaders(response, enabled, retentionInDays); + StepVerifier.create(client.getPropertiesWithResponse()) + .assertNext(r -> FileShareTestHelper.assertShareChangeFeedProperties(r, enabled, retentionInDays)) + .verifyComplete(); + } finally { + client.delete().block(); + } + } + + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2027-03-07") + @ParameterizedTest + @MethodSource("com.azure.storage.file.share.FileShareTestHelper#setPropertiesShareChangeFeedSupplier") + public void setPropertiesShareChangeFeed(Boolean enabled, Integer retentionInDays) { + ShareAsyncClient client = premiumFileServiceAsyncClient.getShareAsyncClient(shareName); + client.createWithResponse(new ShareCreateOptions().setChangeFeedEnabled(true).setChangeFeedRetentionInDays(7)) + .block(); + try { + ShareSetPropertiesOptions options = new ShareSetPropertiesOptions().setChangeFeedEnabled(enabled) + .setChangeFeedRetentionInDays(retentionInDays); + StepVerifier.create(client.setPropertiesWithResponse(options).flatMap(response -> { + assertEquals(200, response.getStatusCode()); + FileShareTestHelper.assertShareChangeFeedRequestHeaders(response, enabled, retentionInDays); + return client.getPropertiesWithResponse(); + })) + .assertNext(r -> FileShareTestHelper.assertShareChangeFeedProperties(r, + enabled == null ? true : enabled, + Boolean.FALSE.equals(enabled) ? retentionInDays + : retentionInDays == null ? Integer.valueOf(7) : retentionInDays)) + .verifyComplete(); + } finally { + client.delete().block(); + } + } + @PlaybackOnly @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2025-01-05") @Test From feced9744f17bfdcff0d5930d8ed53468d0fc81b Mon Sep 17 00:00:00 2001 From: browndav Date: Tue, 6 Oct 2026 18:36:30 -0400 Subject: [PATCH 08/13] change all docs to say 2026-06-06 for change feed --- .../file/share/models/ShareProperties.java | 18 +++++++++--------- .../file/share/options/ShareCreateOptions.java | 8 ++++---- .../options/ShareSetPropertiesOptions.java | 8 ++++---- .../storage/file/share/ShareApiTests.java | 4 ++-- .../storage/file/share/ShareAsyncApiTests.java | 4 ++-- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java index 4fb7bc7c83fd3..c722c50510931 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareProperties.java @@ -169,20 +169,20 @@ public final class ShareProperties implements XmlSerializable { private Boolean enableSmbDirectoryLease; /* - * Optional. Supported in version 2026-02-01 and above. + * Optional. Supported in version 2026-06-06 and above. * Specifies whether change feed is enabled on the share. */ private Boolean enableChangeFeed; /* - * Optional. Supported in version 2026-02-01 and above. + * Optional. Supported in version 2026-06-06 and above. * The number of days that change feed records are retained on the share. Valid values are between 1 and 365 * inclusive. Default if not specified is 7 days. */ private Integer changeFeedRetentionInDays; /* - * Optional. Supported in version 2026-02-01 and above. The name of the blob container where the change feed + * Optional. Supported in version 2026-06-06 and above. The name of the blob container where the change feed * records are stored. The name of the blob container is in the format {@code $fileschangefeed-}. */ private String changeFeedBlobContainerName; @@ -846,7 +846,7 @@ public ShareProperties setSmbDirectoryLeaseEnabled(Boolean enableSmbDirectoryLea } /** - * Optional. Supported in version 2026-02-01 and above. + * Optional. Supported in version 2026-06-06 and above. * Specifies whether change feed is enabled on the share. * @return the enableChangeFeed value, or {@code null} if not returned by the service. */ @@ -855,7 +855,7 @@ public Boolean isChangeFeedEnabled() { } /** - * Optional. Supported in version 2026-02-01 and above. + * Optional. Supported in version 2026-06-06 and above. * Specifies whether change feed is enabled on the share. * @param enableChangeFeed the enableChangeFeed value to set, or {@code null} if unavailable. * @return the ShareProperties object itself. @@ -866,7 +866,7 @@ public ShareProperties setChangeFeedEnabled(Boolean enableChangeFeed) { } /** - * Optional. Supported in version 2026-02-01 and above. + * Optional. Supported in version 2026-06-06 and above. * The number of days that change feed records are retained on the share. Valid values are between 1 and 365 * inclusive. Default if not specified is 7 days. * @return the changeFeedRetentionInDays value, or {@code null} if not returned by the service. @@ -876,7 +876,7 @@ public Integer getChangeFeedRetentionInDays() { } /** - * Optional. Supported in version 2026-02-01 and above. + * Optional. Supported in version 2026-06-06 and above. * The number of days that change feed records are retained on the share. Valid values are between 1 and 365 * inclusive. Default if not specified is 7 days. * @param changeFeedRetentionInDays the changeFeedRetentionInDays value to set, or {@code null} if unavailable. @@ -888,7 +888,7 @@ public ShareProperties setChangeFeedRetentionInDays(Integer changeFeedRetentionI } /** - * Optional. Supported in version 2026-02-01 and above. The name of the blob container where the change feed + * Optional. Supported in version 2026-06-06 and above. The name of the blob container where the change feed * records are stored. The name of the blob container is in the format {@code $fileschangefeed-}. * @return the blobContainerForChangeFeed value. */ @@ -897,7 +897,7 @@ public String getChangeFeedBlobContainerName() { } /** - * Optional. Supported in version 2026-02-01 and above. The name of the blob container where the change feed + * Optional. Supported in version 2026-06-06 and above. The name of the blob container where the change feed * records are stored. The name of the blob container is in the format {@code $fileschangefeed-}. * @param changeFeedBlobContainerName the blobContainerForChangeFeed value to set. * @return the ShareProperties object itself. diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java index 2f4d014c58b82..8df83ad5d6842 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java @@ -282,7 +282,7 @@ public ShareCreateOptions setProvisionedMaxBandwidthMibps(Long provisionedMaxBan /** * Get the enableChangeFeed property: - * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. + * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. * This property enables change feed on the share. * @return the enableChangeFeed value. */ @@ -292,7 +292,7 @@ public Boolean isChangeFeedEnabled() { /** * Set the enableChangeFeed property: - * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. + * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. * This property enables change feed on the share. * @param enableChangeFeed the enableChangeFeed value to set. * @return the ShareCreateOptions object itself. @@ -304,7 +304,7 @@ public ShareCreateOptions setChangeFeedEnabled(Boolean enableChangeFeed) { /** * Get the changeFeedRetentionInDays property: - * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. + * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. * The number of days that change feed records are retained. * @return the changeFeedRetentionInDays value. */ @@ -314,7 +314,7 @@ public Integer getChangeFeedRetentionInDays() { /** * Set the changeFeedRetentionInDays property: - * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. + * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. * The number of days that change feed records are retained. * @param changeFeedRetentionInDays the changeFeedRetentionInDays value to set. * @return the ShareCreateOptions object itself. diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java index 57a8a30eb9e69..ad6dea9e5daaf 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java @@ -261,7 +261,7 @@ public ShareSetPropertiesOptions setProvisionedMaxBandwidthMibps(Long provisione /** * Get the enableChangeFeed property: - * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. + * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. * This property enables change feed on the share. * @return the enableChangeFeed value. */ @@ -271,7 +271,7 @@ public Boolean isChangeFeedEnabled() { /** * Set the enableChangeFeed property: - * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. + * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. * This property enables change feed on the share. * @param enableChangeFeed the enableChangeFeed value to set. * @return the ShareSetPropertiesOptions object itself. @@ -283,7 +283,7 @@ public ShareSetPropertiesOptions setChangeFeedEnabled(Boolean enableChangeFeed) /** * Get the changeFeedRetentionInDays property: - * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. + * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. * The number of days that change feed records are retained. * @return the changeFeedRetentionInDays value. */ @@ -293,7 +293,7 @@ public Integer getChangeFeedRetentionInDays() { /** * Set the changeFeedRetentionInDays property: - * Optional. Supported in version 2027-03-07 and above. Only applicable for premium file storage accounts. + * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. * The number of days that change feed records are retained. * @param changeFeedRetentionInDays the changeFeedRetentionInDays value to set. * @return the ShareSetPropertiesOptions object itself. diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java index 39a3aad391bbf..d91a3c386ebfc 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java @@ -1524,7 +1524,7 @@ public void setPropertiesSharePaidBursting() { premiumFileServiceClient.getShareClient(shareName).delete(); } - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2027-03-07") + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2026-06-06") @ParameterizedTest @MethodSource("com.azure.storage.file.share.FileShareTestHelper#createShareChangeFeedSupplier") public void createShareChangeFeed(Boolean enabled, Integer retentionInDays) { @@ -1543,7 +1543,7 @@ public void createShareChangeFeed(Boolean enabled, Integer retentionInDays) { } } - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2027-03-07") + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2026-06-06") @ParameterizedTest @MethodSource("com.azure.storage.file.share.FileShareTestHelper#setPropertiesShareChangeFeedSupplier") public void setPropertiesShareChangeFeed(Boolean enabled, Integer retentionInDays) { diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java index af2a0659f5c4b..a9e785847554c 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java @@ -1159,7 +1159,7 @@ public void setPropertiesSharePaidBursting() { premiumFileServiceAsyncClient.getShareAsyncClient(shareName).delete().block(); } - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2027-03-07") + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2026-06-06") @ParameterizedTest @MethodSource("com.azure.storage.file.share.FileShareTestHelper#createShareChangeFeedSupplier") public void createShareChangeFeed(Boolean enabled, Integer retentionInDays) { @@ -1179,7 +1179,7 @@ public void createShareChangeFeed(Boolean enabled, Integer retentionInDays) { } } - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2027-03-07") + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2026-06-06") @ParameterizedTest @MethodSource("com.azure.storage.file.share.FileShareTestHelper#setPropertiesShareChangeFeedSupplier") public void setPropertiesShareChangeFeed(Boolean enabled, Integer retentionInDays) { From 9a1b3647e5bb4e69bd8024427a5692857057e7ac Mon Sep 17 00:00:00 2001 From: browndav Date: Tue, 6 Oct 2026 18:38:19 -0400 Subject: [PATCH 09/13] spotless apply --- .../java/com/azure/storage/file/share/ShareApiTests.java | 7 ++++--- .../com/azure/storage/file/share/ShareAsyncApiTests.java | 9 +++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java index d91a3c386ebfc..5ef63c276d29c 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareApiTests.java @@ -1536,8 +1536,8 @@ public void createShareChangeFeed(Boolean enabled, Integer retentionInDays) { try { assertEquals(201, response.getStatusCode()); FileShareTestHelper.assertShareChangeFeedRequestHeaders(response, enabled, retentionInDays); - FileShareTestHelper.assertShareChangeFeedProperties(client.getPropertiesWithResponse(null, null), - enabled, retentionInDays); + FileShareTestHelper.assertShareChangeFeedProperties(client.getPropertiesWithResponse(null, null), enabled, + retentionInDays); } finally { client.delete(); } @@ -1558,7 +1558,8 @@ public void setPropertiesShareChangeFeed(Boolean enabled, Integer retentionInDay FileShareTestHelper.assertShareChangeFeedRequestHeaders(response, enabled, retentionInDays); FileShareTestHelper.assertShareChangeFeedProperties(client.getPropertiesWithResponse(null, null), enabled == null ? true : enabled, - Boolean.FALSE.equals(enabled) ? retentionInDays + Boolean.FALSE.equals(enabled) + ? retentionInDays : retentionInDays == null ? Integer.valueOf(7) : retentionInDays); } finally { client.delete(); diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java index a9e785847554c..7c841ef4a0933 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/ShareAsyncApiTests.java @@ -1194,10 +1194,11 @@ public void setPropertiesShareChangeFeed(Boolean enabled, Integer retentionInDay FileShareTestHelper.assertShareChangeFeedRequestHeaders(response, enabled, retentionInDays); return client.getPropertiesWithResponse(); })) - .assertNext(r -> FileShareTestHelper.assertShareChangeFeedProperties(r, - enabled == null ? true : enabled, - Boolean.FALSE.equals(enabled) ? retentionInDays - : retentionInDays == null ? Integer.valueOf(7) : retentionInDays)) + .assertNext( + r -> FileShareTestHelper.assertShareChangeFeedProperties(r, enabled == null ? true : enabled, + Boolean.FALSE.equals(enabled) + ? retentionInDays + : retentionInDays == null ? Integer.valueOf(7) : retentionInDays)) .verifyComplete(); } finally { client.delete().block(); From aeea3c5aebd6faef6f33ff6f4204fc31c59f4a71 Mon Sep 17 00:00:00 2001 From: Isabelle Date: Sun, 11 Oct 2026 08:38:37 -0700 Subject: [PATCH 10/13] changelog update --- sdk/storage/azure-storage-file-share/CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sdk/storage/azure-storage-file-share/CHANGELOG.md b/sdk/storage/azure-storage-file-share/CHANGELOG.md index 4a0436ad7c62d..ad282ccc25f29 100644 --- a/sdk/storage/azure-storage-file-share/CHANGELOG.md +++ b/sdk/storage/azure-storage-file-share/CHANGELOG.md @@ -12,6 +12,11 @@ - Added `NfsFileType.BLOCK_DEVICE`, `NfsFileType.CHARACTER_DEVICE`, `NfsFileType.SOCKET` and `NfsFileType.FIFO`. - Added `ShareListFilesAndDirectoriesOptions.setIncludePermissions`, `setIncludeLinkCount`, `setIncludeNfsAttributes` and `setIncludeAll`. +- Added support for change feed on premium file shares. Added `ShareCreateOptions.setChangeFeedEnabled`, + `setChangeFeedRetentionInDays` and `ShareSetPropertiesOptions.setChangeFeedEnabled`, + `setChangeFeedRetentionInDays` to enable and configure change feed. +- Added `ShareProperties.isChangeFeedEnabled()`, `getChangeFeedRetentionInDays()` and + `getChangeFeedBlobContainerName()`. ### Breaking Changes From 98a711309347a33376d18aacc463a182bf07ebd9 Mon Sep 17 00:00:00 2001 From: Isabelle Date: Sun, 11 Oct 2026 08:43:01 -0700 Subject: [PATCH 11/13] adding more documentation to retention getters and setters --- .../storage/file/share/options/ShareCreateOptions.java | 6 ++++-- .../file/share/options/ShareSetPropertiesOptions.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java index 8df83ad5d6842..a13468bbd4d59 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareCreateOptions.java @@ -305,7 +305,8 @@ public ShareCreateOptions setChangeFeedEnabled(Boolean enableChangeFeed) { /** * Get the changeFeedRetentionInDays property: * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. - * The number of days that change feed records are retained. + * The number of days that change feed records are retained. Valid values are between 1 and 365 inclusive. + * Default if not specified is 7 days. * @return the changeFeedRetentionInDays value. */ public Integer getChangeFeedRetentionInDays() { @@ -315,7 +316,8 @@ public Integer getChangeFeedRetentionInDays() { /** * Set the changeFeedRetentionInDays property: * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. - * The number of days that change feed records are retained. + * The number of days that change feed records are retained. Valid values are between 1 and 365 inclusive. + * Default if not specified is 7 days. * @param changeFeedRetentionInDays the changeFeedRetentionInDays value to set. * @return the ShareCreateOptions object itself. */ diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java index ad6dea9e5daaf..b034a6e2fa42a 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareSetPropertiesOptions.java @@ -284,7 +284,8 @@ public ShareSetPropertiesOptions setChangeFeedEnabled(Boolean enableChangeFeed) /** * Get the changeFeedRetentionInDays property: * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. - * The number of days that change feed records are retained. + * The number of days that change feed records are retained. Valid values are between 1 and 365 inclusive. + * Default if not specified is 7 days. * @return the changeFeedRetentionInDays value. */ public Integer getChangeFeedRetentionInDays() { @@ -294,7 +295,8 @@ public Integer getChangeFeedRetentionInDays() { /** * Set the changeFeedRetentionInDays property: * Optional. Supported in version 2026-06-06 and above. Only applicable for premium file storage accounts. - * The number of days that change feed records are retained. + * The number of days that change feed records are retained. Valid values are between 1 and 365 inclusive. + * Default if not specified is 7 days. * @param changeFeedRetentionInDays the changeFeedRetentionInDays value to set. * @return the ShareSetPropertiesOptions object itself. */ From a42179d80e17ba73f69870b4151b3af945c1d12e Mon Sep 17 00:00:00 2001 From: browndav Date: Tue, 13 Oct 2026 13:58:53 -0400 Subject: [PATCH 12/13] Revert "Storage - STG105 NFS List V2 Files and Directories (#50036)" This reverts commit 83dc6e28852ace9e902975682ab5510671ca56e2. --- .../azure-storage-file-share/CHANGELOG.md | 9 - .../azure-storage-file-share/assets.json | 2 +- .../file/share/ShareDirectoryAsyncClient.java | 18 +- .../file/share/ShareDirectoryClient.java | 18 +- .../ShareFileItemConstructorProxy.java | 88 ------ .../models/BlockDeviceItem.java | 268 ------------------ .../implementation/models/CharDeviceItem.java | 268 ------------------ .../implementation/models/DirectoryItem.java | 31 -- .../share/implementation/models/FifoItem.java | 205 -------------- .../share/implementation/models/FileItem.java | 63 ---- .../implementation/models/FileProperty.java | 93 ------ .../FilesAndDirectoriesListSegment.java | 177 ------------ .../InternalShareFileItemProperties.java | 49 ---- .../models/ListFilesIncludeType.java | 22 +- .../implementation/models/SocketItem.java | 205 -------------- .../implementation/models/SymLinkItem.java | 237 ---------------- .../implementation/util/ModelHelper.java | 134 ++------- .../file/share/models/NfsFileType.java | 39 +-- .../file/share/models/ShareFileItem.java | 81 +----- .../share/models/ShareFileItemProperties.java | 27 -- .../ShareListFilesAndDirectoriesOptions.java | 84 ------ .../storage/file/share/DirectoryApiTests.java | 146 ---------- .../file/share/DirectoryAsyncApiTests.java | 151 ---------- .../DirectoryListingDeserializationTests.java | 169 ----------- .../ListFilesAndDirectoriesResponse.xml | 121 -------- .../swagger/README.md | 2 +- .../main/java/ShareStorageCustomization.java | 8 - 27 files changed, 61 insertions(+), 2654 deletions(-) delete mode 100644 sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/accesshelpers/ShareFileItemConstructorProxy.java delete mode 100644 sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/BlockDeviceItem.java delete mode 100644 sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/CharDeviceItem.java delete mode 100644 sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FifoItem.java delete mode 100644 sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SocketItem.java delete mode 100644 sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SymLinkItem.java delete mode 100644 sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryListingDeserializationTests.java delete mode 100644 sdk/storage/azure-storage-file-share/src/test/resources/testfiles/ListFilesAndDirectoriesResponse.xml diff --git a/sdk/storage/azure-storage-file-share/CHANGELOG.md b/sdk/storage/azure-storage-file-share/CHANGELOG.md index 4a0436ad7c62d..2a0f298b45393 100644 --- a/sdk/storage/azure-storage-file-share/CHANGELOG.md +++ b/sdk/storage/azure-storage-file-share/CHANGELOG.md @@ -3,15 +3,6 @@ ## 12.32.0-beta.2 (Unreleased) ### Features Added -- Added support for NFS List Files and Directories V2. `ShareDirectoryClient.listFilesAndDirectories` now returns - symbolic links, block devices, character devices, FIFOs and sockets in addition to files and directories. -- Added `ShareFileItem.getLinkCount()`, `ShareFileItem.getFileType()`, `ShareFileItem.getLinkText()`, - `ShareFileItem.getDeviceMajor()` and `ShareFileItem.getDeviceMinor()`. -- Added `ShareFileItemProperties.getOwner()`, `ShareFileItemProperties.getGroup()` and - `ShareFileItemProperties.getFileMode()`. -- Added `NfsFileType.BLOCK_DEVICE`, `NfsFileType.CHARACTER_DEVICE`, `NfsFileType.SOCKET` and `NfsFileType.FIFO`. -- Added `ShareListFilesAndDirectoriesOptions.setIncludePermissions`, `setIncludeLinkCount`, `setIncludeNfsAttributes` - and `setIncludeAll`. ### Breaking Changes diff --git a/sdk/storage/azure-storage-file-share/assets.json b/sdk/storage/azure-storage-file-share/assets.json index eabc0bb2c022e..2096399e6a768 100644 --- a/sdk/storage/azure-storage-file-share/assets.json +++ b/sdk/storage/azure-storage-file-share/assets.json @@ -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_741d1f4fbd" + "Tag": "java/storage/azure-storage-file-share_1e9eb49640" } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryAsyncClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryAsyncClient.java index da521421629a9..575d1d9f9b912 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryAsyncClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryAsyncClient.java @@ -51,6 +51,7 @@ import reactor.core.publisher.Mono; import java.time.Duration; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; @@ -979,7 +980,22 @@ PagedFlux listFilesAndDirectoriesWithOptionalTimeout(ShareListFil final ShareListFilesAndDirectoriesOptions modifiedOptions = options == null ? new ShareListFilesAndDirectoriesOptions() : options; - final List finalIncludeTypes = ModelHelper.getListFilesIncludeTypes(modifiedOptions); + List includeTypes = new ArrayList<>(); + if (modifiedOptions.includeAttributes()) { + includeTypes.add(ListFilesIncludeType.ATTRIBUTES); + } + if (modifiedOptions.includeETag()) { + includeTypes.add(ListFilesIncludeType.ETAG); + } + if (modifiedOptions.includeTimestamps()) { + includeTypes.add(ListFilesIncludeType.TIMESTAMPS); + } + if (modifiedOptions.includePermissionKey()) { + includeTypes.add(ListFilesIncludeType.PERMISSION_KEY); + } + + // these options must be absent from request if empty or false + final List finalIncludeTypes = includeTypes.isEmpty() ? null : includeTypes; BiFunction>> retriever = (marker, pageSize) -> StorageImplUtils diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryClient.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryClient.java index 3780bc4143750..416626a7113e8 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryClient.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryClient.java @@ -58,6 +58,7 @@ import com.azure.storage.file.share.sas.ShareServiceSasSignatureValues; import java.time.Duration; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import java.util.Map; @@ -945,7 +946,22 @@ public PagedIterable listFilesAndDirectories(ShareListFilesAndDir final ShareListFilesAndDirectoriesOptions modifiedOptions = options == null ? new ShareListFilesAndDirectoriesOptions() : options; - final List finalIncludeTypes = ModelHelper.getListFilesIncludeTypes(modifiedOptions); + List includeTypes = new ArrayList<>(); + if (modifiedOptions.includeAttributes()) { + includeTypes.add(ListFilesIncludeType.ATTRIBUTES); + } + if (modifiedOptions.includeETag()) { + includeTypes.add(ListFilesIncludeType.ETAG); + } + if (modifiedOptions.includeTimestamps()) { + includeTypes.add(ListFilesIncludeType.TIMESTAMPS); + } + if (modifiedOptions.includePermissionKey()) { + includeTypes.add(ListFilesIncludeType.PERMISSION_KEY); + } + + // these options must be absent from request if empty or false + final List finalIncludeTypes = includeTypes.isEmpty() ? null : includeTypes; BiFunction> retriever = (marker, pageSize) -> { Callable> operation diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/accesshelpers/ShareFileItemConstructorProxy.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/accesshelpers/ShareFileItemConstructorProxy.java deleted file mode 100644 index 102cfaa712c6e..0000000000000 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/accesshelpers/ShareFileItemConstructorProxy.java +++ /dev/null @@ -1,88 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.storage.file.share.implementation.accesshelpers; - -import com.azure.storage.file.share.models.NfsFileType; -import com.azure.storage.file.share.models.NtfsFileAttributes; -import com.azure.storage.file.share.models.ShareFileItem; -import com.azure.storage.file.share.models.ShareFileItemProperties; - -import java.util.EnumSet; - -/** - * Helper class to access private values of {@link ShareFileItem} across package boundaries. - */ -public final class ShareFileItemConstructorProxy { - private static ShareFileItemConstructorAccessor accessor; - - private ShareFileItemConstructorProxy() { - } - - /** - * Type defining the methods to create a {@link ShareFileItem} instance with non-public properties. - */ - public interface ShareFileItemConstructorAccessor { - /** - * Creates a new instance of {@link ShareFileItem}. - * - * @param name Name of the file or the directory. - * @param isDirectory A boolean set to true if the reference is a directory, false if the reference is a file. - * @param id ID of the file or directory. - * @param properties Properties of the file or directory. - * @param fileAttributes NTFS attributes of the file or directory. - * @param permissionKey Permission key of the file or directory. - * @param fileSize Size of a file. - * @param linkCount The number of hard links to the file or directory. - * @param fileType The type of the file or directory. - * @param linkText The target path of the symbolic link. - * @param deviceMajor The major device number. - * @param deviceMinor The minor device number. - * @return A new instance of {@link ShareFileItem}. - */ - ShareFileItem create(String name, boolean isDirectory, String id, ShareFileItemProperties properties, - EnumSet fileAttributes, String permissionKey, Long fileSize, Long linkCount, - NfsFileType fileType, String linkText, Long deviceMajor, Long deviceMinor); - } - - /** - * The method called from {@link ShareFileItem} to set its accessor. - * - * @param accessor The accessor. - */ - public static void setAccessor(final ShareFileItemConstructorAccessor accessor) { - ShareFileItemConstructorProxy.accessor = accessor; - } - - /** - * Creates a new instance of {@link ShareFileItem}. - * - * @param name Name of the file or the directory. - * @param isDirectory A boolean set to true if the reference is a directory, false if the reference is a file. - * @param id ID of the file or directory. - * @param properties Properties of the file or directory. - * @param fileAttributes NTFS attributes of the file or directory. - * @param permissionKey Permission key of the file or directory. - * @param fileSize Size of a file. - * @param linkCount The number of hard links to the file or directory. - * @param fileType The type of the file or directory. - * @param linkText The target path of the symbolic link. - * @param deviceMajor The major device number. - * @param deviceMinor The minor device number. - * @return A new instance of {@link ShareFileItem}. - */ - public static ShareFileItem create(String name, boolean isDirectory, String id, ShareFileItemProperties properties, - EnumSet fileAttributes, String permissionKey, Long fileSize, Long linkCount, - NfsFileType fileType, String linkText, Long deviceMajor, Long deviceMinor) { - // This looks odd but is necessary, it is possible to engage the access helper before anywhere else in the - // application accesses ShareFileItem which triggers the accessor to be configured. So, if the accessor - // is null this effectively pokes the class to set up the accessor. - if (accessor == null) { - new ShareFileItem(null, false, null); - } - - assert accessor != null; - return accessor.create(name, isDirectory, id, properties, fileAttributes, permissionKey, fileSize, linkCount, - fileType, linkText, deviceMajor, deviceMinor); - } -} diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/BlockDeviceItem.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/BlockDeviceItem.java deleted file mode 100644 index 3e9ae98f8d4ad..0000000000000 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/BlockDeviceItem.java +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.file.share.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.xml.XmlReader; -import com.azure.xml.XmlSerializable; -import com.azure.xml.XmlToken; -import com.azure.xml.XmlWriter; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; - -/** - * A listed block device item. - */ -@Fluent -public final class BlockDeviceItem implements XmlSerializable { - /* - * The Name property. - */ - @Generated - private StringEncoded name; - - /* - * The FileId property. - */ - @Generated - private String fileId; - - /* - * File properties. - */ - @Generated - private FileProperty properties; - - /* - * The LinkCount property. - */ - @Generated - private Long linkCount; - - /* - * The DeviceMajor property. - */ - @Generated - private Long deviceMajor; - - /* - * The DeviceMinor property. - */ - @Generated - private Long deviceMinor; - - /** - * Creates an instance of BlockDeviceItem class. - */ - @Generated - public BlockDeviceItem() { - } - - /** - * Get the name property: The Name property. - * - * @return the name value. - */ - @Generated - public StringEncoded getName() { - return this.name; - } - - /** - * Set the name property: The Name property. - * - * @param name the name value to set. - * @return the BlockDeviceItem object itself. - */ - @Generated - public BlockDeviceItem setName(StringEncoded name) { - this.name = name; - return this; - } - - /** - * Get the fileId property: The FileId property. - * - * @return the fileId value. - */ - @Generated - public String getFileId() { - return this.fileId; - } - - /** - * Set the fileId property: The FileId property. - * - * @param fileId the fileId value to set. - * @return the BlockDeviceItem object itself. - */ - @Generated - public BlockDeviceItem setFileId(String fileId) { - this.fileId = fileId; - return this; - } - - /** - * Get the properties property: File properties. - * - * @return the properties value. - */ - @Generated - public FileProperty getProperties() { - return this.properties; - } - - /** - * Set the properties property: File properties. - * - * @param properties the properties value to set. - * @return the BlockDeviceItem object itself. - */ - @Generated - public BlockDeviceItem setProperties(FileProperty properties) { - this.properties = properties; - return this; - } - - /** - * Get the linkCount property: The LinkCount property. - * - * @return the linkCount value. - */ - @Generated - public Long getLinkCount() { - return this.linkCount; - } - - /** - * Set the linkCount property: The LinkCount property. - * - * @param linkCount the linkCount value to set. - * @return the BlockDeviceItem object itself. - */ - @Generated - public BlockDeviceItem setLinkCount(Long linkCount) { - this.linkCount = linkCount; - return this; - } - - /** - * Get the deviceMajor property: The DeviceMajor property. - * - * @return the deviceMajor value. - */ - @Generated - public Long getDeviceMajor() { - return this.deviceMajor; - } - - /** - * Set the deviceMajor property: The DeviceMajor property. - * - * @param deviceMajor the deviceMajor value to set. - * @return the BlockDeviceItem object itself. - */ - @Generated - public BlockDeviceItem setDeviceMajor(Long deviceMajor) { - this.deviceMajor = deviceMajor; - return this; - } - - /** - * Get the deviceMinor property: The DeviceMinor property. - * - * @return the deviceMinor value. - */ - @Generated - public Long getDeviceMinor() { - return this.deviceMinor; - } - - /** - * Set the deviceMinor property: The DeviceMinor property. - * - * @param deviceMinor the deviceMinor value to set. - * @return the BlockDeviceItem object itself. - */ - @Generated - public BlockDeviceItem setDeviceMinor(Long deviceMinor) { - this.deviceMinor = deviceMinor; - return this; - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { - return toXml(xmlWriter, null); - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "BlockDevice" : rootElementName; - xmlWriter.writeStartElement(rootElementName); - xmlWriter.writeXml(this.name, "Name"); - xmlWriter.writeStringElement("FileId", this.fileId); - xmlWriter.writeXml(this.properties, "Properties"); - xmlWriter.writeNumberElement("LinkCount", this.linkCount); - xmlWriter.writeNumberElement("DeviceMajor", this.deviceMajor); - xmlWriter.writeNumberElement("DeviceMinor", this.deviceMinor); - return xmlWriter.writeEndElement(); - } - - /** - * Reads an instance of BlockDeviceItem from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @return An instance of BlockDeviceItem if the XmlReader was pointing to an instance of it, or null if it was - * pointing to XML null. - * @throws XMLStreamException If an error occurs while reading the BlockDeviceItem. - */ - @Generated - public static BlockDeviceItem fromXml(XmlReader xmlReader) throws XMLStreamException { - return fromXml(xmlReader, null); - } - - /** - * Reads an instance of BlockDeviceItem from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @param rootElementName Optional root element name to override the default defined by the model. Used to support - * cases where the model can deserialize from different root element names. - * @return An instance of BlockDeviceItem if the XmlReader was pointing to an instance of it, or null if it was - * pointing to XML null. - * @throws XMLStreamException If an error occurs while reading the BlockDeviceItem. - */ - @Generated - public static BlockDeviceItem fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { - String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "BlockDevice" : rootElementName; - return xmlReader.readObject(finalRootElementName, reader -> { - BlockDeviceItem deserializedBlockDeviceItem = new BlockDeviceItem(); - while (reader.nextElement() != XmlToken.END_ELEMENT) { - QName elementName = reader.getElementName(); - - if ("Name".equals(elementName.getLocalPart())) { - deserializedBlockDeviceItem.name = StringEncoded.fromXml(reader, "Name"); - } else if ("FileId".equals(elementName.getLocalPart())) { - deserializedBlockDeviceItem.fileId = reader.getStringElement(); - } else if ("Properties".equals(elementName.getLocalPart())) { - deserializedBlockDeviceItem.properties = FileProperty.fromXml(reader, "Properties"); - } else if ("LinkCount".equals(elementName.getLocalPart())) { - deserializedBlockDeviceItem.linkCount = reader.getNullableElement(Long::parseLong); - } else if ("DeviceMajor".equals(elementName.getLocalPart())) { - deserializedBlockDeviceItem.deviceMajor = reader.getNullableElement(Long::parseLong); - } else if ("DeviceMinor".equals(elementName.getLocalPart())) { - deserializedBlockDeviceItem.deviceMinor = reader.getNullableElement(Long::parseLong); - } else { - reader.skipElement(); - } - } - - return deserializedBlockDeviceItem; - }); - } -} diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/CharDeviceItem.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/CharDeviceItem.java deleted file mode 100644 index a77395bcaa283..0000000000000 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/CharDeviceItem.java +++ /dev/null @@ -1,268 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.file.share.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.xml.XmlReader; -import com.azure.xml.XmlSerializable; -import com.azure.xml.XmlToken; -import com.azure.xml.XmlWriter; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; - -/** - * A listed character device item. - */ -@Fluent -public final class CharDeviceItem implements XmlSerializable { - /* - * The Name property. - */ - @Generated - private StringEncoded name; - - /* - * The FileId property. - */ - @Generated - private String fileId; - - /* - * File properties. - */ - @Generated - private FileProperty properties; - - /* - * The LinkCount property. - */ - @Generated - private Long linkCount; - - /* - * The DeviceMajor property. - */ - @Generated - private Long deviceMajor; - - /* - * The DeviceMinor property. - */ - @Generated - private Long deviceMinor; - - /** - * Creates an instance of CharDeviceItem class. - */ - @Generated - public CharDeviceItem() { - } - - /** - * Get the name property: The Name property. - * - * @return the name value. - */ - @Generated - public StringEncoded getName() { - return this.name; - } - - /** - * Set the name property: The Name property. - * - * @param name the name value to set. - * @return the CharDeviceItem object itself. - */ - @Generated - public CharDeviceItem setName(StringEncoded name) { - this.name = name; - return this; - } - - /** - * Get the fileId property: The FileId property. - * - * @return the fileId value. - */ - @Generated - public String getFileId() { - return this.fileId; - } - - /** - * Set the fileId property: The FileId property. - * - * @param fileId the fileId value to set. - * @return the CharDeviceItem object itself. - */ - @Generated - public CharDeviceItem setFileId(String fileId) { - this.fileId = fileId; - return this; - } - - /** - * Get the properties property: File properties. - * - * @return the properties value. - */ - @Generated - public FileProperty getProperties() { - return this.properties; - } - - /** - * Set the properties property: File properties. - * - * @param properties the properties value to set. - * @return the CharDeviceItem object itself. - */ - @Generated - public CharDeviceItem setProperties(FileProperty properties) { - this.properties = properties; - return this; - } - - /** - * Get the linkCount property: The LinkCount property. - * - * @return the linkCount value. - */ - @Generated - public Long getLinkCount() { - return this.linkCount; - } - - /** - * Set the linkCount property: The LinkCount property. - * - * @param linkCount the linkCount value to set. - * @return the CharDeviceItem object itself. - */ - @Generated - public CharDeviceItem setLinkCount(Long linkCount) { - this.linkCount = linkCount; - return this; - } - - /** - * Get the deviceMajor property: The DeviceMajor property. - * - * @return the deviceMajor value. - */ - @Generated - public Long getDeviceMajor() { - return this.deviceMajor; - } - - /** - * Set the deviceMajor property: The DeviceMajor property. - * - * @param deviceMajor the deviceMajor value to set. - * @return the CharDeviceItem object itself. - */ - @Generated - public CharDeviceItem setDeviceMajor(Long deviceMajor) { - this.deviceMajor = deviceMajor; - return this; - } - - /** - * Get the deviceMinor property: The DeviceMinor property. - * - * @return the deviceMinor value. - */ - @Generated - public Long getDeviceMinor() { - return this.deviceMinor; - } - - /** - * Set the deviceMinor property: The DeviceMinor property. - * - * @param deviceMinor the deviceMinor value to set. - * @return the CharDeviceItem object itself. - */ - @Generated - public CharDeviceItem setDeviceMinor(Long deviceMinor) { - this.deviceMinor = deviceMinor; - return this; - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { - return toXml(xmlWriter, null); - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "CharDevice" : rootElementName; - xmlWriter.writeStartElement(rootElementName); - xmlWriter.writeXml(this.name, "Name"); - xmlWriter.writeStringElement("FileId", this.fileId); - xmlWriter.writeXml(this.properties, "Properties"); - xmlWriter.writeNumberElement("LinkCount", this.linkCount); - xmlWriter.writeNumberElement("DeviceMajor", this.deviceMajor); - xmlWriter.writeNumberElement("DeviceMinor", this.deviceMinor); - return xmlWriter.writeEndElement(); - } - - /** - * Reads an instance of CharDeviceItem from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @return An instance of CharDeviceItem if the XmlReader was pointing to an instance of it, or null if it was - * pointing to XML null. - * @throws XMLStreamException If an error occurs while reading the CharDeviceItem. - */ - @Generated - public static CharDeviceItem fromXml(XmlReader xmlReader) throws XMLStreamException { - return fromXml(xmlReader, null); - } - - /** - * Reads an instance of CharDeviceItem from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @param rootElementName Optional root element name to override the default defined by the model. Used to support - * cases where the model can deserialize from different root element names. - * @return An instance of CharDeviceItem if the XmlReader was pointing to an instance of it, or null if it was - * pointing to XML null. - * @throws XMLStreamException If an error occurs while reading the CharDeviceItem. - */ - @Generated - public static CharDeviceItem fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { - String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "CharDevice" : rootElementName; - return xmlReader.readObject(finalRootElementName, reader -> { - CharDeviceItem deserializedCharDeviceItem = new CharDeviceItem(); - while (reader.nextElement() != XmlToken.END_ELEMENT) { - QName elementName = reader.getElementName(); - - if ("Name".equals(elementName.getLocalPart())) { - deserializedCharDeviceItem.name = StringEncoded.fromXml(reader, "Name"); - } else if ("FileId".equals(elementName.getLocalPart())) { - deserializedCharDeviceItem.fileId = reader.getStringElement(); - } else if ("Properties".equals(elementName.getLocalPart())) { - deserializedCharDeviceItem.properties = FileProperty.fromXml(reader, "Properties"); - } else if ("LinkCount".equals(elementName.getLocalPart())) { - deserializedCharDeviceItem.linkCount = reader.getNullableElement(Long::parseLong); - } else if ("DeviceMajor".equals(elementName.getLocalPart())) { - deserializedCharDeviceItem.deviceMajor = reader.getNullableElement(Long::parseLong); - } else if ("DeviceMinor".equals(elementName.getLocalPart())) { - deserializedCharDeviceItem.deviceMinor = reader.getNullableElement(Long::parseLong); - } else { - reader.skipElement(); - } - } - - return deserializedCharDeviceItem; - }); - } -} diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/DirectoryItem.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/DirectoryItem.java index d5f7362025ebb..5b72c5ea86d4d 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/DirectoryItem.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/DirectoryItem.java @@ -48,12 +48,6 @@ public final class DirectoryItem implements XmlSerializable { @Generated private String permissionKey; - /* - * The LinkCount property. - */ - @Generated - private Long linkCount; - /** * Creates an instance of DirectoryItem class. */ @@ -171,28 +165,6 @@ public DirectoryItem setPermissionKey(String permissionKey) { return this; } - /** - * Get the linkCount property: The LinkCount property. - * - * @return the linkCount value. - */ - @Generated - public Long getLinkCount() { - return this.linkCount; - } - - /** - * Set the linkCount property: The LinkCount property. - * - * @param linkCount the linkCount value to set. - * @return the DirectoryItem object itself. - */ - @Generated - public DirectoryItem setLinkCount(Long linkCount) { - this.linkCount = linkCount; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -209,7 +181,6 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt xmlWriter.writeXml(this.properties, "Properties"); xmlWriter.writeStringElement("Attributes", this.attributes); xmlWriter.writeStringElement("PermissionKey", this.permissionKey); - xmlWriter.writeNumberElement("LinkCount", this.linkCount); return xmlWriter.writeEndElement(); } @@ -255,8 +226,6 @@ public static DirectoryItem fromXml(XmlReader xmlReader, String rootElementName) deserializedDirectoryItem.attributes = reader.getStringElement(); } else if ("PermissionKey".equals(elementName.getLocalPart())) { deserializedDirectoryItem.permissionKey = reader.getStringElement(); - } else if ("LinkCount".equals(elementName.getLocalPart())) { - deserializedDirectoryItem.linkCount = reader.getNullableElement(Long::parseLong); } else { reader.skipElement(); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FifoItem.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FifoItem.java deleted file mode 100644 index e5c65219909e2..0000000000000 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FifoItem.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.file.share.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.xml.XmlReader; -import com.azure.xml.XmlSerializable; -import com.azure.xml.XmlToken; -import com.azure.xml.XmlWriter; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; - -/** - * A listed FIFO item. - */ -@Fluent -public final class FifoItem implements XmlSerializable { - /* - * The Name property. - */ - @Generated - private StringEncoded name; - - /* - * The FileId property. - */ - @Generated - private String fileId; - - /* - * File properties. - */ - @Generated - private FileProperty properties; - - /* - * The LinkCount property. - */ - @Generated - private Long linkCount; - - /** - * Creates an instance of FifoItem class. - */ - @Generated - public FifoItem() { - } - - /** - * Get the name property: The Name property. - * - * @return the name value. - */ - @Generated - public StringEncoded getName() { - return this.name; - } - - /** - * Set the name property: The Name property. - * - * @param name the name value to set. - * @return the FifoItem object itself. - */ - @Generated - public FifoItem setName(StringEncoded name) { - this.name = name; - return this; - } - - /** - * Get the fileId property: The FileId property. - * - * @return the fileId value. - */ - @Generated - public String getFileId() { - return this.fileId; - } - - /** - * Set the fileId property: The FileId property. - * - * @param fileId the fileId value to set. - * @return the FifoItem object itself. - */ - @Generated - public FifoItem setFileId(String fileId) { - this.fileId = fileId; - return this; - } - - /** - * Get the properties property: File properties. - * - * @return the properties value. - */ - @Generated - public FileProperty getProperties() { - return this.properties; - } - - /** - * Set the properties property: File properties. - * - * @param properties the properties value to set. - * @return the FifoItem object itself. - */ - @Generated - public FifoItem setProperties(FileProperty properties) { - this.properties = properties; - return this; - } - - /** - * Get the linkCount property: The LinkCount property. - * - * @return the linkCount value. - */ - @Generated - public Long getLinkCount() { - return this.linkCount; - } - - /** - * Set the linkCount property: The LinkCount property. - * - * @param linkCount the linkCount value to set. - * @return the FifoItem object itself. - */ - @Generated - public FifoItem setLinkCount(Long linkCount) { - this.linkCount = linkCount; - return this; - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { - return toXml(xmlWriter, null); - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "Fifo" : rootElementName; - xmlWriter.writeStartElement(rootElementName); - xmlWriter.writeXml(this.name, "Name"); - xmlWriter.writeStringElement("FileId", this.fileId); - xmlWriter.writeXml(this.properties, "Properties"); - xmlWriter.writeNumberElement("LinkCount", this.linkCount); - return xmlWriter.writeEndElement(); - } - - /** - * Reads an instance of FifoItem from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @return An instance of FifoItem if the XmlReader was pointing to an instance of it, or null if it was pointing to - * XML null. - * @throws XMLStreamException If an error occurs while reading the FifoItem. - */ - @Generated - public static FifoItem fromXml(XmlReader xmlReader) throws XMLStreamException { - return fromXml(xmlReader, null); - } - - /** - * Reads an instance of FifoItem from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @param rootElementName Optional root element name to override the default defined by the model. Used to support - * cases where the model can deserialize from different root element names. - * @return An instance of FifoItem if the XmlReader was pointing to an instance of it, or null if it was pointing to - * XML null. - * @throws XMLStreamException If an error occurs while reading the FifoItem. - */ - @Generated - public static FifoItem fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { - String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "Fifo" : rootElementName; - return xmlReader.readObject(finalRootElementName, reader -> { - FifoItem deserializedFifoItem = new FifoItem(); - while (reader.nextElement() != XmlToken.END_ELEMENT) { - QName elementName = reader.getElementName(); - - if ("Name".equals(elementName.getLocalPart())) { - deserializedFifoItem.name = StringEncoded.fromXml(reader, "Name"); - } else if ("FileId".equals(elementName.getLocalPart())) { - deserializedFifoItem.fileId = reader.getStringElement(); - } else if ("Properties".equals(elementName.getLocalPart())) { - deserializedFifoItem.properties = FileProperty.fromXml(reader, "Properties"); - } else if ("LinkCount".equals(elementName.getLocalPart())) { - deserializedFifoItem.linkCount = reader.getNullableElement(Long::parseLong); - } else { - reader.skipElement(); - } - } - - return deserializedFifoItem; - }); - } -} diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FileItem.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FileItem.java index 7b81cef5460cb..c8338e96372d3 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FileItem.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FileItem.java @@ -6,7 +6,6 @@ import com.azure.core.annotation.Fluent; import com.azure.core.annotation.Generated; -import com.azure.storage.file.share.models.NfsFileType; import com.azure.xml.XmlReader; import com.azure.xml.XmlSerializable; import com.azure.xml.XmlToken; @@ -49,18 +48,6 @@ public final class FileItem implements XmlSerializable { @Generated private String permissionKey; - /* - * The LinkCount property. - */ - @Generated - private Long linkCount; - - /* - * Type of the file. - */ - @Generated - private NfsFileType fileType; - /** * Creates an instance of FileItem class. */ @@ -178,50 +165,6 @@ public FileItem setPermissionKey(String permissionKey) { return this; } - /** - * Get the linkCount property: The LinkCount property. - * - * @return the linkCount value. - */ - @Generated - public Long getLinkCount() { - return this.linkCount; - } - - /** - * Set the linkCount property: The LinkCount property. - * - * @param linkCount the linkCount value to set. - * @return the FileItem object itself. - */ - @Generated - public FileItem setLinkCount(Long linkCount) { - this.linkCount = linkCount; - return this; - } - - /** - * Get the fileType property: Type of the file. - * - * @return the fileType value. - */ - @Generated - public NfsFileType getFileType() { - return this.fileType; - } - - /** - * Set the fileType property: Type of the file. - * - * @param fileType the fileType value to set. - * @return the FileItem object itself. - */ - @Generated - public FileItem setFileType(NfsFileType fileType) { - this.fileType = fileType; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -238,8 +181,6 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt xmlWriter.writeXml(this.properties, "Properties"); xmlWriter.writeStringElement("Attributes", this.attributes); xmlWriter.writeStringElement("PermissionKey", this.permissionKey); - xmlWriter.writeNumberElement("LinkCount", this.linkCount); - xmlWriter.writeStringElement("FileType", this.fileType == null ? null : this.fileType.toString()); return xmlWriter.writeEndElement(); } @@ -284,10 +225,6 @@ public static FileItem fromXml(XmlReader xmlReader, String rootElementName) thro deserializedFileItem.attributes = reader.getStringElement(); } else if ("PermissionKey".equals(elementName.getLocalPart())) { deserializedFileItem.permissionKey = reader.getStringElement(); - } else if ("LinkCount".equals(elementName.getLocalPart())) { - deserializedFileItem.linkCount = reader.getNullableElement(Long::parseLong); - } else if ("FileType".equals(elementName.getLocalPart())) { - deserializedFileItem.fileType = NfsFileType.fromString(reader.getStringElement()); } else { reader.skipElement(); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FileProperty.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FileProperty.java index 1ab9a4d68a6cd..7bf07bbc0a4d3 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FileProperty.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FileProperty.java @@ -67,24 +67,6 @@ public final class FileProperty implements XmlSerializable { @Generated private String etag; - /* - * The Uid property. - */ - @Generated - private String uid; - - /* - * The Gid property. - */ - @Generated - private String gid; - - /* - * The Mode property. - */ - @Generated - private String mode; - /** * Creates an instance of FileProperty class. */ @@ -257,72 +239,6 @@ public FileProperty setEtag(String etag) { return this; } - /** - * Get the uid property: The Uid property. - * - * @return the uid value. - */ - @Generated - public String getUid() { - return this.uid; - } - - /** - * Set the uid property: The Uid property. - * - * @param uid the uid value to set. - * @return the FileProperty object itself. - */ - @Generated - public FileProperty setUid(String uid) { - this.uid = uid; - return this; - } - - /** - * Get the gid property: The Gid property. - * - * @return the gid value. - */ - @Generated - public String getGid() { - return this.gid; - } - - /** - * Set the gid property: The Gid property. - * - * @param gid the gid value to set. - * @return the FileProperty object itself. - */ - @Generated - public FileProperty setGid(String gid) { - this.gid = gid; - return this; - } - - /** - * Get the mode property: The Mode property. - * - * @return the mode value. - */ - @Generated - public String getMode() { - return this.mode; - } - - /** - * Set the mode property: The Mode property. - * - * @param mode the mode value to set. - * @return the FileProperty object itself. - */ - @Generated - public FileProperty setMode(String mode) { - this.mode = mode; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -345,9 +261,6 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt this.changeTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.changeTime)); xmlWriter.writeStringElement("Last-Modified", Objects.toString(this.lastModified, null)); xmlWriter.writeStringElement("Etag", this.etag); - xmlWriter.writeStringElement("Uid", this.uid); - xmlWriter.writeStringElement("Gid", this.gid); - xmlWriter.writeStringElement("Mode", this.mode); return xmlWriter.writeEndElement(); } @@ -401,12 +314,6 @@ public static FileProperty fromXml(XmlReader xmlReader, String rootElementName) deserializedFileProperty.lastModified = reader.getNullableElement(DateTimeRfc1123::new); } else if ("Etag".equals(elementName.getLocalPart())) { deserializedFileProperty.etag = reader.getStringElement(); - } else if ("Uid".equals(elementName.getLocalPart())) { - deserializedFileProperty.uid = reader.getStringElement(); - } else if ("Gid".equals(elementName.getLocalPart())) { - deserializedFileProperty.gid = reader.getStringElement(); - } else if ("Mode".equals(elementName.getLocalPart())) { - deserializedFileProperty.mode = reader.getStringElement(); } else { reader.skipElement(); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesAndDirectoriesListSegment.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesAndDirectoriesListSegment.java index 7c7d7ba082d9d..db47d0b499b2a 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesAndDirectoriesListSegment.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/FilesAndDirectoriesListSegment.java @@ -32,36 +32,6 @@ public final class FilesAndDirectoriesListSegment implements XmlSerializable fileItems = new ArrayList<>(); - /* - * The SymLinkItems property. - */ - @Generated - private List symLinkItems = new ArrayList<>(); - - /* - * The BlockDeviceItems property. - */ - @Generated - private List blockDeviceItems = new ArrayList<>(); - - /* - * The CharDeviceItems property. - */ - @Generated - private List charDeviceItems = new ArrayList<>(); - - /* - * The FifoItems property. - */ - @Generated - private List fifoItems = new ArrayList<>(); - - /* - * The SocketItems property. - */ - @Generated - private List socketItems = new ArrayList<>(); - /** * Creates an instance of FilesAndDirectoriesListSegment class. */ @@ -113,116 +83,6 @@ public FilesAndDirectoriesListSegment setFileItems(List fileItems) { return this; } - /** - * Get the symLinkItems property: The SymLinkItems property. - * - * @return the symLinkItems value. - */ - @Generated - public List getSymLinkItems() { - return this.symLinkItems; - } - - /** - * Set the symLinkItems property: The SymLinkItems property. - * - * @param symLinkItems the symLinkItems value to set. - * @return the FilesAndDirectoriesListSegment object itself. - */ - @Generated - public FilesAndDirectoriesListSegment setSymLinkItems(List symLinkItems) { - this.symLinkItems = symLinkItems; - return this; - } - - /** - * Get the blockDeviceItems property: The BlockDeviceItems property. - * - * @return the blockDeviceItems value. - */ - @Generated - public List getBlockDeviceItems() { - return this.blockDeviceItems; - } - - /** - * Set the blockDeviceItems property: The BlockDeviceItems property. - * - * @param blockDeviceItems the blockDeviceItems value to set. - * @return the FilesAndDirectoriesListSegment object itself. - */ - @Generated - public FilesAndDirectoriesListSegment setBlockDeviceItems(List blockDeviceItems) { - this.blockDeviceItems = blockDeviceItems; - return this; - } - - /** - * Get the charDeviceItems property: The CharDeviceItems property. - * - * @return the charDeviceItems value. - */ - @Generated - public List getCharDeviceItems() { - return this.charDeviceItems; - } - - /** - * Set the charDeviceItems property: The CharDeviceItems property. - * - * @param charDeviceItems the charDeviceItems value to set. - * @return the FilesAndDirectoriesListSegment object itself. - */ - @Generated - public FilesAndDirectoriesListSegment setCharDeviceItems(List charDeviceItems) { - this.charDeviceItems = charDeviceItems; - return this; - } - - /** - * Get the fifoItems property: The FifoItems property. - * - * @return the fifoItems value. - */ - @Generated - public List getFifoItems() { - return this.fifoItems; - } - - /** - * Set the fifoItems property: The FifoItems property. - * - * @param fifoItems the fifoItems value to set. - * @return the FilesAndDirectoriesListSegment object itself. - */ - @Generated - public FilesAndDirectoriesListSegment setFifoItems(List fifoItems) { - this.fifoItems = fifoItems; - return this; - } - - /** - * Get the socketItems property: The SocketItems property. - * - * @return the socketItems value. - */ - @Generated - public List getSocketItems() { - return this.socketItems; - } - - /** - * Set the socketItems property: The SocketItems property. - * - * @param socketItems the socketItems value to set. - * @return the FilesAndDirectoriesListSegment object itself. - */ - @Generated - public FilesAndDirectoriesListSegment setSocketItems(List socketItems) { - this.socketItems = socketItems; - return this; - } - @Generated @Override public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { @@ -244,31 +104,6 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt xmlWriter.writeXml(element, "File"); } } - if (this.symLinkItems != null) { - for (SymLinkItem element : this.symLinkItems) { - xmlWriter.writeXml(element, "SymLink"); - } - } - if (this.blockDeviceItems != null) { - for (BlockDeviceItem element : this.blockDeviceItems) { - xmlWriter.writeXml(element, "BlockDevice"); - } - } - if (this.charDeviceItems != null) { - for (CharDeviceItem element : this.charDeviceItems) { - xmlWriter.writeXml(element, "CharDevice"); - } - } - if (this.fifoItems != null) { - for (FifoItem element : this.fifoItems) { - xmlWriter.writeXml(element, "Fifo"); - } - } - if (this.socketItems != null) { - for (SocketItem element : this.socketItems) { - xmlWriter.writeXml(element, "Socket"); - } - } return xmlWriter.writeEndElement(); } @@ -311,18 +146,6 @@ public static FilesAndDirectoriesListSegment fromXml(XmlReader xmlReader, String .add(DirectoryItem.fromXml(reader, "Directory")); } else if ("File".equals(elementName.getLocalPart())) { deserializedFilesAndDirectoriesListSegment.fileItems.add(FileItem.fromXml(reader, "File")); - } else if ("SymLink".equals(elementName.getLocalPart())) { - deserializedFilesAndDirectoriesListSegment.symLinkItems.add(SymLinkItem.fromXml(reader, "SymLink")); - } else if ("BlockDevice".equals(elementName.getLocalPart())) { - deserializedFilesAndDirectoriesListSegment.blockDeviceItems - .add(BlockDeviceItem.fromXml(reader, "BlockDevice")); - } else if ("CharDevice".equals(elementName.getLocalPart())) { - deserializedFilesAndDirectoriesListSegment.charDeviceItems - .add(CharDeviceItem.fromXml(reader, "CharDevice")); - } else if ("Fifo".equals(elementName.getLocalPart())) { - deserializedFilesAndDirectoriesListSegment.fifoItems.add(FifoItem.fromXml(reader, "Fifo")); - } else if ("Socket".equals(elementName.getLocalPart())) { - deserializedFilesAndDirectoriesListSegment.socketItems.add(SocketItem.fromXml(reader, "Socket")); } else { reader.skipElement(); } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/InternalShareFileItemProperties.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/InternalShareFileItemProperties.java index cd22b208c175d..bf3520e8f0885 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/InternalShareFileItemProperties.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/InternalShareFileItemProperties.java @@ -14,9 +14,6 @@ public class InternalShareFileItemProperties implements ShareFileItemProperties private final OffsetDateTime changedOn; private final OffsetDateTime lastModified; private final String eTag; - private final String owner; - private final String group; - private final String fileMode; /** * Creates an instance of share item properties. @@ -30,34 +27,12 @@ public class InternalShareFileItemProperties implements ShareFileItemProperties */ public InternalShareFileItemProperties(OffsetDateTime createdOn, OffsetDateTime lastAccessedOn, OffsetDateTime lastWrittenOn, OffsetDateTime changedOn, OffsetDateTime lastModified, String eTag) { - this(createdOn, lastAccessedOn, lastWrittenOn, changedOn, lastModified, eTag, null, null, null); - } - - /** - * Creates an instance of share item properties. - * - * @param createdOn Datetime the item was created. - * @param lastAccessedOn Datetime the item was last accessed. - * @param lastWrittenOn Datetime the item was last written. - * @param changedOn Datetime the item was last changed. - * @param lastModified Datetime the item was last modified. - * @param eTag ETag of the item. - * @param owner Owner user identifier (UID) of the item. - * @param group Owning group identifier (GID) of the item. - * @param fileMode POSIX file mode of the item. - */ - public InternalShareFileItemProperties(OffsetDateTime createdOn, OffsetDateTime lastAccessedOn, - OffsetDateTime lastWrittenOn, OffsetDateTime changedOn, OffsetDateTime lastModified, String eTag, String owner, - String group, String fileMode) { this.createdOn = createdOn; this.lastAccessedOn = lastAccessedOn; this.lastWrittenOn = lastWrittenOn; this.changedOn = changedOn; this.lastModified = lastModified; this.eTag = eTag; - this.owner = owner; - this.group = group; - this.fileMode = fileMode; } /** @@ -101,28 +76,4 @@ public OffsetDateTime getLastModified() { public String getETag() { return eTag; } - - /** - * @return Owner user identifier (UID) of this item. - */ - @Override - public String getOwner() { - return owner; - } - - /** - * @return Owning group identifier (GID) of this item. - */ - @Override - public String getGroup() { - return group; - } - - /** - * @return POSIX file mode of this item. - */ - @Override - public String getFileMode() { - return fileMode; - } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ListFilesIncludeType.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ListFilesIncludeType.java index ae0fc295e9256..183e5958cebbf 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ListFilesIncludeType.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/ListFilesIncludeType.java @@ -26,27 +26,7 @@ public enum ListFilesIncludeType { /** * Enum value PermissionKey. */ - PERMISSION_KEY("PermissionKey"), - - /** - * Enum value Permissions. - */ - PERMISSIONS("Permissions"), - - /** - * Enum value LinkCount. - */ - LINK_COUNT("LinkCount"), - - /** - * Enum value NfsAttributes. - */ - NFS_ATTRIBUTES("NfsAttributes"), - - /** - * Enum value All. - */ - ALL("All"); + PERMISSION_KEY("PermissionKey"); /** * The actual serialized value for a ListFilesIncludeType instance. diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SocketItem.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SocketItem.java deleted file mode 100644 index 823076df0e8f1..0000000000000 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SocketItem.java +++ /dev/null @@ -1,205 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.file.share.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.xml.XmlReader; -import com.azure.xml.XmlSerializable; -import com.azure.xml.XmlToken; -import com.azure.xml.XmlWriter; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; - -/** - * A listed socket item. - */ -@Fluent -public final class SocketItem implements XmlSerializable { - /* - * The Name property. - */ - @Generated - private StringEncoded name; - - /* - * The FileId property. - */ - @Generated - private String fileId; - - /* - * File properties. - */ - @Generated - private FileProperty properties; - - /* - * The LinkCount property. - */ - @Generated - private Long linkCount; - - /** - * Creates an instance of SocketItem class. - */ - @Generated - public SocketItem() { - } - - /** - * Get the name property: The Name property. - * - * @return the name value. - */ - @Generated - public StringEncoded getName() { - return this.name; - } - - /** - * Set the name property: The Name property. - * - * @param name the name value to set. - * @return the SocketItem object itself. - */ - @Generated - public SocketItem setName(StringEncoded name) { - this.name = name; - return this; - } - - /** - * Get the fileId property: The FileId property. - * - * @return the fileId value. - */ - @Generated - public String getFileId() { - return this.fileId; - } - - /** - * Set the fileId property: The FileId property. - * - * @param fileId the fileId value to set. - * @return the SocketItem object itself. - */ - @Generated - public SocketItem setFileId(String fileId) { - this.fileId = fileId; - return this; - } - - /** - * Get the properties property: File properties. - * - * @return the properties value. - */ - @Generated - public FileProperty getProperties() { - return this.properties; - } - - /** - * Set the properties property: File properties. - * - * @param properties the properties value to set. - * @return the SocketItem object itself. - */ - @Generated - public SocketItem setProperties(FileProperty properties) { - this.properties = properties; - return this; - } - - /** - * Get the linkCount property: The LinkCount property. - * - * @return the linkCount value. - */ - @Generated - public Long getLinkCount() { - return this.linkCount; - } - - /** - * Set the linkCount property: The LinkCount property. - * - * @param linkCount the linkCount value to set. - * @return the SocketItem object itself. - */ - @Generated - public SocketItem setLinkCount(Long linkCount) { - this.linkCount = linkCount; - return this; - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { - return toXml(xmlWriter, null); - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "Socket" : rootElementName; - xmlWriter.writeStartElement(rootElementName); - xmlWriter.writeXml(this.name, "Name"); - xmlWriter.writeStringElement("FileId", this.fileId); - xmlWriter.writeXml(this.properties, "Properties"); - xmlWriter.writeNumberElement("LinkCount", this.linkCount); - return xmlWriter.writeEndElement(); - } - - /** - * Reads an instance of SocketItem from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @return An instance of SocketItem if the XmlReader was pointing to an instance of it, or null if it was pointing - * to XML null. - * @throws XMLStreamException If an error occurs while reading the SocketItem. - */ - @Generated - public static SocketItem fromXml(XmlReader xmlReader) throws XMLStreamException { - return fromXml(xmlReader, null); - } - - /** - * Reads an instance of SocketItem from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @param rootElementName Optional root element name to override the default defined by the model. Used to support - * cases where the model can deserialize from different root element names. - * @return An instance of SocketItem if the XmlReader was pointing to an instance of it, or null if it was pointing - * to XML null. - * @throws XMLStreamException If an error occurs while reading the SocketItem. - */ - @Generated - public static SocketItem fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { - String finalRootElementName = rootElementName == null || rootElementName.isEmpty() ? "Socket" : rootElementName; - return xmlReader.readObject(finalRootElementName, reader -> { - SocketItem deserializedSocketItem = new SocketItem(); - while (reader.nextElement() != XmlToken.END_ELEMENT) { - QName elementName = reader.getElementName(); - - if ("Name".equals(elementName.getLocalPart())) { - deserializedSocketItem.name = StringEncoded.fromXml(reader, "Name"); - } else if ("FileId".equals(elementName.getLocalPart())) { - deserializedSocketItem.fileId = reader.getStringElement(); - } else if ("Properties".equals(elementName.getLocalPart())) { - deserializedSocketItem.properties = FileProperty.fromXml(reader, "Properties"); - } else if ("LinkCount".equals(elementName.getLocalPart())) { - deserializedSocketItem.linkCount = reader.getNullableElement(Long::parseLong); - } else { - reader.skipElement(); - } - } - - return deserializedSocketItem; - }); - } -} diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SymLinkItem.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SymLinkItem.java deleted file mode 100644 index 5b0b95ed93e48..0000000000000 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SymLinkItem.java +++ /dev/null @@ -1,237 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - -package com.azure.storage.file.share.implementation.models; - -import com.azure.core.annotation.Fluent; -import com.azure.core.annotation.Generated; -import com.azure.xml.XmlReader; -import com.azure.xml.XmlSerializable; -import com.azure.xml.XmlToken; -import com.azure.xml.XmlWriter; -import javax.xml.namespace.QName; -import javax.xml.stream.XMLStreamException; - -/** - * A listed symbolic link item. - */ -@Fluent -public final class SymLinkItem implements XmlSerializable { - /* - * The Name property. - */ - @Generated - private StringEncoded name; - - /* - * The FileId property. - */ - @Generated - private String fileId; - - /* - * File properties. - */ - @Generated - private FileProperty properties; - - /* - * The LinkCount property. - */ - @Generated - private Long linkCount; - - /* - * The LinkText property. - */ - @Generated - private String linkText; - - /** - * Creates an instance of SymLinkItem class. - */ - @Generated - public SymLinkItem() { - } - - /** - * Get the name property: The Name property. - * - * @return the name value. - */ - @Generated - public StringEncoded getName() { - return this.name; - } - - /** - * Set the name property: The Name property. - * - * @param name the name value to set. - * @return the SymLinkItem object itself. - */ - @Generated - public SymLinkItem setName(StringEncoded name) { - this.name = name; - return this; - } - - /** - * Get the fileId property: The FileId property. - * - * @return the fileId value. - */ - @Generated - public String getFileId() { - return this.fileId; - } - - /** - * Set the fileId property: The FileId property. - * - * @param fileId the fileId value to set. - * @return the SymLinkItem object itself. - */ - @Generated - public SymLinkItem setFileId(String fileId) { - this.fileId = fileId; - return this; - } - - /** - * Get the properties property: File properties. - * - * @return the properties value. - */ - @Generated - public FileProperty getProperties() { - return this.properties; - } - - /** - * Set the properties property: File properties. - * - * @param properties the properties value to set. - * @return the SymLinkItem object itself. - */ - @Generated - public SymLinkItem setProperties(FileProperty properties) { - this.properties = properties; - return this; - } - - /** - * Get the linkCount property: The LinkCount property. - * - * @return the linkCount value. - */ - @Generated - public Long getLinkCount() { - return this.linkCount; - } - - /** - * Set the linkCount property: The LinkCount property. - * - * @param linkCount the linkCount value to set. - * @return the SymLinkItem object itself. - */ - @Generated - public SymLinkItem setLinkCount(Long linkCount) { - this.linkCount = linkCount; - return this; - } - - /** - * Get the linkText property: The LinkText property. - * - * @return the linkText value. - */ - @Generated - public String getLinkText() { - return this.linkText; - } - - /** - * Set the linkText property: The LinkText property. - * - * @param linkText the linkText value to set. - * @return the SymLinkItem object itself. - */ - @Generated - public SymLinkItem setLinkText(String linkText) { - this.linkText = linkText; - return this; - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter) throws XMLStreamException { - return toXml(xmlWriter, null); - } - - @Generated - @Override - public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLStreamException { - rootElementName = rootElementName == null || rootElementName.isEmpty() ? "SymLink" : rootElementName; - xmlWriter.writeStartElement(rootElementName); - xmlWriter.writeXml(this.name, "Name"); - xmlWriter.writeStringElement("FileId", this.fileId); - xmlWriter.writeXml(this.properties, "Properties"); - xmlWriter.writeNumberElement("LinkCount", this.linkCount); - xmlWriter.writeStringElement("LinkText", this.linkText); - return xmlWriter.writeEndElement(); - } - - /** - * Reads an instance of SymLinkItem from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @return An instance of SymLinkItem if the XmlReader was pointing to an instance of it, or null if it was pointing - * to XML null. - * @throws XMLStreamException If an error occurs while reading the SymLinkItem. - */ - @Generated - public static SymLinkItem fromXml(XmlReader xmlReader) throws XMLStreamException { - return fromXml(xmlReader, null); - } - - /** - * Reads an instance of SymLinkItem from the XmlReader. - * - * @param xmlReader The XmlReader being read. - * @param rootElementName Optional root element name to override the default defined by the model. Used to support - * cases where the model can deserialize from different root element names. - * @return An instance of SymLinkItem if the XmlReader was pointing to an instance of it, or null if it was pointing - * to XML null. - * @throws XMLStreamException If an error occurs while reading the SymLinkItem. - */ - @Generated - public static SymLinkItem fromXml(XmlReader xmlReader, String rootElementName) throws XMLStreamException { - String finalRootElementName - = rootElementName == null || rootElementName.isEmpty() ? "SymLink" : rootElementName; - return xmlReader.readObject(finalRootElementName, reader -> { - SymLinkItem deserializedSymLinkItem = new SymLinkItem(); - while (reader.nextElement() != XmlToken.END_ELEMENT) { - QName elementName = reader.getElementName(); - - if ("Name".equals(elementName.getLocalPart())) { - deserializedSymLinkItem.name = StringEncoded.fromXml(reader, "Name"); - } else if ("FileId".equals(elementName.getLocalPart())) { - deserializedSymLinkItem.fileId = reader.getStringElement(); - } else if ("Properties".equals(elementName.getLocalPart())) { - deserializedSymLinkItem.properties = FileProperty.fromXml(reader, "Properties"); - } else if ("LinkCount".equals(elementName.getLocalPart())) { - deserializedSymLinkItem.linkCount = reader.getNullableElement(Long::parseLong); - } else if ("LinkText".equals(elementName.getLocalPart())) { - deserializedSymLinkItem.linkText = reader.getStringElement(); - } else { - reader.skipElement(); - } - } - - return deserializedSymLinkItem; - }); - } -} diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java index dd398752a1cd0..a6830e7cb854a 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/util/ModelHelper.java @@ -23,21 +23,14 @@ import com.azure.storage.file.share.implementation.accesshelpers.ShareDirectoryPropertiesHelper; import com.azure.storage.file.share.implementation.accesshelpers.ShareFileDownloadHeadersConstructorProxy; import com.azure.storage.file.share.implementation.accesshelpers.ShareFileInfoHelper; -import com.azure.storage.file.share.implementation.accesshelpers.ShareFileItemConstructorProxy; import com.azure.storage.file.share.implementation.accesshelpers.ShareFilePropertiesHelper; import com.azure.storage.file.share.implementation.accesshelpers.ShareFileSymbolicLinkInfoHelper; -import com.azure.storage.file.share.implementation.models.BlockDeviceItem; -import com.azure.storage.file.share.implementation.models.CharDeviceItem; import com.azure.storage.file.share.implementation.models.DeleteSnapshotsOptionType; import com.azure.storage.file.share.implementation.models.DirectoriesCreateHeaders; import com.azure.storage.file.share.implementation.models.DirectoriesGetPropertiesHeaders; import com.azure.storage.file.share.implementation.models.DirectoriesSetMetadataHeaders; import com.azure.storage.file.share.implementation.models.DirectoriesSetPropertiesHeaders; -import com.azure.storage.file.share.implementation.models.DirectoryItem; -import com.azure.storage.file.share.implementation.models.FifoItem; import com.azure.storage.file.share.implementation.models.FileProperty; -import com.azure.storage.file.share.implementation.models.FileItem; -import com.azure.storage.file.share.implementation.models.FilesAndDirectoriesListSegment; import com.azure.storage.file.share.implementation.models.FilesCreateHardLinkHeaders; import com.azure.storage.file.share.implementation.models.FilesCreateHeaders; import com.azure.storage.file.share.implementation.models.FilesCreateSymbolicLinkHeaders; @@ -50,7 +43,6 @@ import com.azure.storage.file.share.implementation.models.FilesUploadRangeHeaders; import com.azure.storage.file.share.implementation.models.InternalShareFileItemProperties; import com.azure.storage.file.share.implementation.models.ListFilesAndDirectoriesSegmentResponse; -import com.azure.storage.file.share.implementation.models.ListFilesIncludeType; import com.azure.storage.file.share.implementation.models.ServicesListSharesSegmentHeaders; import com.azure.storage.file.share.implementation.models.ShareItemInternal; import com.azure.storage.file.share.implementation.models.SharePropertiesInternal; @@ -58,9 +50,7 @@ import com.azure.storage.file.share.implementation.models.ShareStorageExceptionInternal; import com.azure.storage.file.share.implementation.models.SharesCreateSnapshotHeaders; import com.azure.storage.file.share.implementation.models.SharesGetPropertiesHeaders; -import com.azure.storage.file.share.implementation.models.SocketItem; import com.azure.storage.file.share.implementation.models.StringEncoded; -import com.azure.storage.file.share.implementation.models.SymLinkItem; import com.azure.storage.file.share.models.ClearRange; import com.azure.storage.file.share.models.CopyStatusType; import com.azure.storage.file.share.models.CopyableFileSmbPropertiesList; @@ -70,7 +60,6 @@ import com.azure.storage.file.share.models.LeaseDurationType; import com.azure.storage.file.share.models.LeaseStateType; import com.azure.storage.file.share.models.LeaseStatusType; -import com.azure.storage.file.share.models.NfsFileType; import com.azure.storage.file.share.models.NtfsFileAttributes; import com.azure.storage.file.share.models.ShareDirectoryInfo; import com.azure.storage.file.share.models.ShareDirectoryProperties; @@ -98,7 +87,6 @@ import com.azure.storage.file.share.models.ShareStatistics; import com.azure.storage.file.share.models.ShareStorageException; import com.azure.storage.file.share.options.ShareFileCopyOptions; -import com.azure.storage.file.share.options.ShareListFilesAndDirectoriesOptions; import java.io.UnsupportedEncodingException; import java.net.URLDecoder; @@ -113,7 +101,6 @@ import java.util.Map; import java.util.Set; import java.util.TreeSet; -import java.util.function.Function; import static com.azure.core.http.HttpHeaderName.LAST_MODIFIED; @@ -316,8 +303,7 @@ public static ShareFileItemProperties transformFileProperty(FileProperty propert return null; } return new InternalShareFileItemProperties(property.getCreationTime(), property.getLastAccessTime(), - property.getLastWriteTime(), property.getChangeTime(), property.getLastModified(), property.getEtag(), - property.getUid(), property.getGid(), property.getMode()); + property.getLastWriteTime(), property.getChangeTime(), property.getLastModified(), property.getEtag()); } public static HandleItem @@ -630,110 +616,26 @@ public static Response mapGetStatisticsResponse(Response res) { Set shareFileItems = new TreeSet<>(Comparator.comparing(ShareFileItem::getName)); if (res.getValue().getSegment() != null) { - FilesAndDirectoriesListSegment segment = res.getValue().getSegment(); - - addShareFileItems(shareFileItems, segment.getDirectoryItems(), ModelHelper::createDirectoryShareItem); - addShareFileItems(shareFileItems, segment.getFileItems(), ModelHelper::createFileShareItem); - addShareFileItems(shareFileItems, segment.getSymLinkItems(), ModelHelper::createSymLinkShareItem); - addShareFileItems(shareFileItems, segment.getBlockDeviceItems(), ModelHelper::createBlockDeviceShareItem); - addShareFileItems(shareFileItems, segment.getCharDeviceItems(), ModelHelper::createCharDeviceShareItem); - addShareFileItems(shareFileItems, segment.getFifoItems(), ModelHelper::createFifoShareItem); - addShareFileItems(shareFileItems, segment.getSocketItems(), ModelHelper::createSocketShareItem); - } - - return new ArrayList<>(shareFileItems); - } - - private static void addShareFileItems(Set shareFileItems, List items, - Function mapper) { - if (items != null) { - items.forEach(item -> shareFileItems.add(mapper.apply(item))); - } - } - - public static void addOptionToList(List includeTypes, boolean isInOptionsBag, T type) { - if (isInOptionsBag) { - includeTypes.add(type); - } - } - - private static ShareFileItem toShareFileItem(StringEncoded name, boolean isDirectory, String fileId, - FileProperty properties, String attributes, String permissionKey, Long fileSize, Long linkCount, - NfsFileType fileType, String linkText, Long deviceMajor, Long deviceMinor) { - return ShareFileItemConstructorProxy.create(ModelHelper.decodeName(name), isDirectory, fileId, - ModelHelper.transformFileProperty(properties), NtfsFileAttributes.toAttributes(attributes), permissionKey, - fileSize, linkCount, fileType, linkText, deviceMajor, deviceMinor); - } - - private static Long getContentLength(FileProperty properties) { - return properties == null ? null : properties.getContentLength(); - } - - private static NfsFileType getDirectoryFileType() { - return NfsFileType.DIRECTORY; - } - - public static List getListFilesIncludeTypes(ShareListFilesAndDirectoriesOptions options) { - if (options == null) { - return null; - } - List includeTypes = new ArrayList<>(); - - if (options.includeAll()) { - includeTypes.add(ListFilesIncludeType.ALL); - } else { - addOptionToList(includeTypes, options.includeAttributes(), ListFilesIncludeType.ATTRIBUTES); - addOptionToList(includeTypes, options.includeETag(), ListFilesIncludeType.ETAG); - addOptionToList(includeTypes, options.includeTimestamps(), ListFilesIncludeType.TIMESTAMPS); - addOptionToList(includeTypes, options.includePermissionKey(), ListFilesIncludeType.PERMISSION_KEY); - addOptionToList(includeTypes, options.includeLinkCount(), ListFilesIncludeType.LINK_COUNT); - addOptionToList(includeTypes, options.includePermissions(), ListFilesIncludeType.PERMISSIONS); - addOptionToList(includeTypes, options.includeNfsAttributes(), ListFilesIncludeType.NFS_ATTRIBUTES); + res.getValue() + .getSegment() + .getDirectoryItems() + .forEach(directoryItem -> shareFileItems + .add(new ShareFileItem(ModelHelper.decodeName(directoryItem.getName()), true, + directoryItem.getFileId(), ModelHelper.transformFileProperty(directoryItem.getProperties()), + NtfsFileAttributes.toAttributes(directoryItem.getAttributes()), + directoryItem.getPermissionKey(), null))); + + res.getValue() + .getSegment() + .getFileItems() + .forEach(fileItem -> shareFileItems.add(new ShareFileItem(ModelHelper.decodeName(fileItem.getName()), + false, fileItem.getFileId(), ModelHelper.transformFileProperty(fileItem.getProperties()), + NtfsFileAttributes.toAttributes(fileItem.getAttributes()), fileItem.getPermissionKey(), + fileItem.getProperties().getContentLength()))); } - return includeTypes.isEmpty() ? null : includeTypes; - } - - private static boolean hasPosixProperties(FileProperty properties) { - return properties != null - && (properties.getUid() != null || properties.getGid() != null || properties.getMode() != null); - } - - private static ShareFileItem createDirectoryShareItem(DirectoryItem item) { - return toShareFileItem(item.getName(), true, item.getFileId(), item.getProperties(), item.getAttributes(), - item.getPermissionKey(), null, item.getLinkCount(), getDirectoryFileType(), null, null, null); - } - - private static ShareFileItem createFileShareItem(FileItem item) { - return toShareFileItem(item.getName(), false, item.getFileId(), item.getProperties(), item.getAttributes(), - item.getPermissionKey(), getContentLength(item.getProperties()), item.getLinkCount(), - item.getFileType() == null ? NfsFileType.REGULAR : item.getFileType(), null, null, null); - } - - private static ShareFileItem createSymLinkShareItem(SymLinkItem item) { - return toShareFileItem(item.getName(), false, item.getFileId(), item.getProperties(), null, null, null, - item.getLinkCount(), NfsFileType.SYM_LINK, item.getLinkText(), null, null); - } - - private static ShareFileItem createBlockDeviceShareItem(BlockDeviceItem item) { - return toShareFileItem(item.getName(), false, item.getFileId(), item.getProperties(), null, null, null, - item.getLinkCount(), NfsFileType.BLOCK_DEVICE, null, item.getDeviceMajor(), item.getDeviceMinor()); - } - - private static ShareFileItem createCharDeviceShareItem(CharDeviceItem item) { - return toShareFileItem(item.getName(), false, item.getFileId(), item.getProperties(), null, null, null, - item.getLinkCount(), NfsFileType.CHARACTER_DEVICE, null, item.getDeviceMajor(), item.getDeviceMinor()); - } - - private static ShareFileItem createFifoShareItem(FifoItem item) { - return toShareFileItem(item.getName(), false, item.getFileId(), item.getProperties(), null, null, null, - item.getLinkCount(), NfsFileType.FIFO, null, null, null); - } - - private static ShareFileItem createSocketShareItem(SocketItem item) { - return toShareFileItem(item.getName(), false, item.getFileId(), item.getProperties(), null, null, null, - item.getLinkCount(), NfsFileType.SOCKET, null, null, null); + return new ArrayList<>(shareFileItems); } public static Response diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/NfsFileType.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/NfsFileType.java index 407f7e3f92710..c252495b5def1 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/NfsFileType.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/NfsFileType.java @@ -1,6 +1,7 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. // Code generated by Microsoft (R) AutoRest Code Generator. + package com.azure.storage.file.share.models; import com.azure.core.annotation.Generated; @@ -8,15 +9,9 @@ import java.util.Collection; /** - * Type of the file. - *

- * This enumeration represents the type of file item in Azure Files shares. The file type is populated for all item - * types in both SMB and NFS-enabled shares. - * - * @see ShareFileItem#getFileType() + * Defines values for NfsFileType. */ public final class NfsFileType extends ExpandableStringEnum { - /** * Static value Regular for NfsFileType. */ @@ -35,33 +30,9 @@ public final class NfsFileType extends ExpandableStringEnum { @Generated public static final NfsFileType SYM_LINK = fromString("SymLink"); - /** - * Static value BlockDevice for NfsFileType. - */ - @Generated - public static final NfsFileType BLOCK_DEVICE = fromString("BlockDevice"); - - /** - * Static value CharacterDevice for NfsFileType. - */ - @Generated - public static final NfsFileType CHARACTER_DEVICE = fromString("CharacterDevice"); - - /** - * Static value Socket for NfsFileType. - */ - @Generated - public static final NfsFileType SOCKET = fromString("Socket"); - - /** - * Static value Fifo for NfsFileType. - */ - @Generated - public static final NfsFileType FIFO = fromString("Fifo"); - /** * Creates a new instance of NfsFileType value. - * + * * @deprecated Use the {@link #fromString(String)} factory method. */ @Generated @@ -71,7 +42,7 @@ public NfsFileType() { /** * Creates or finds a NfsFileType from its string representation. - * + * * @param name a name to look for. * @return the corresponding NfsFileType. */ @@ -82,7 +53,7 @@ public static NfsFileType fromString(String name) { /** * Gets known NfsFileType values. - * + * * @return known NfsFileType values. */ @Generated diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileItem.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileItem.java index db04361e6ea58..991cdf61f3e81 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileItem.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileItem.java @@ -4,7 +4,6 @@ package com.azure.storage.file.share.models; import com.azure.core.annotation.Immutable; -import com.azure.storage.file.share.implementation.accesshelpers.ShareFileItemConstructorProxy; import java.util.EnumSet; @@ -20,15 +19,6 @@ public final class ShareFileItem { private final EnumSet fileAttributes; private final String permissionKey; private final Long fileSize; - private final Long linkCount; - private final NfsFileType fileType; - private final String linkText; - private final Long deviceMajor; - private final Long deviceMinor; - - static { - ShareFileItemConstructorProxy.setAccessor(ShareFileItem::new); - } /** * Creates an instance of file or directory reference information about a specific Share. @@ -38,7 +28,7 @@ public final class ShareFileItem { * @param fileSize Size of a file. Pass {@code null} if the reference is a directory. */ public ShareFileItem(String name, boolean isDirectory, Long fileSize) { - this(name, isDirectory, null, null, null, null, fileSize, null, null, null, null, null); + this(name, isDirectory, null, null, null, null, fileSize); } /** @@ -54,12 +44,6 @@ public ShareFileItem(String name, boolean isDirectory, Long fileSize) { */ public ShareFileItem(String name, boolean isDirectory, String id, ShareFileItemProperties properties, EnumSet fileAttributes, String permissionKey, Long fileSize) { - this(name, isDirectory, id, properties, fileAttributes, permissionKey, fileSize, null, null, null, null, null); - } - - private ShareFileItem(String name, boolean isDirectory, String id, ShareFileItemProperties properties, - EnumSet fileAttributes, String permissionKey, Long fileSize, Long linkCount, - NfsFileType fileType, String linkText, Long deviceMajor, Long deviceMinor) { this.name = name; this.isDirectory = isDirectory; this.id = id; @@ -67,11 +51,6 @@ private ShareFileItem(String name, boolean isDirectory, String id, ShareFileItem this.fileAttributes = fileAttributes; this.permissionKey = permissionKey; this.fileSize = fileSize; - this.linkCount = linkCount; - this.fileType = fileType; - this.linkText = linkText; - this.deviceMajor = deviceMajor; - this.deviceMinor = deviceMinor; } /** @@ -136,62 +115,4 @@ public EnumSet getFileAttributes() { public String getPermissionKey() { return permissionKey; } - - /** - * Gets the count of hard links for this item. - * Applicable to all item types in NFS shares: files, directories, symbolic links, block devices, character - * devices, FIFOs, and sockets. - * Supported in version 2026-12-06 and above. - * - * @return The count of hard links for this item. - */ - public Long getLinkCount() { - return linkCount; - } - - /** - * Gets the file type for this item. - * In SMB shares, this field is populated for files and directories. - * In NFS-enabled shares, this field is populated for files, directories, symbolic links, block devices, - * character devices, FIFOs, and sockets. - * Supported in version 2026-12-06 and above. - * - * @return The file type for this item. - */ - public NfsFileType getFileType() { - return fileType; - } - - /** - * Gets the link text for this item. - * Only applicable to symbolic links in NFS shares. - * Supported in version 2026-12-06 and above. - * - * @return The link text for this item. - */ - public String getLinkText() { - return linkText; - } - - /** - * Gets the major device number for this item. - * Only applicable to block devices and character devices in NFS shares. - * Supported in version 2026-12-06 and above. - * - * @return The major device number for this item. - */ - public Long getDeviceMajor() { - return deviceMajor; - } - - /** - * Gets the minor device number for this item. - * Only applicable to block devices and character devices in NFS shares. - * Supported in version 2026-12-06 and above. - * - * @return The minor device number for this item. - */ - public Long getDeviceMinor() { - return deviceMinor; - } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileItemProperties.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileItemProperties.java index cbff26d7baa3e..5a817fe23ff96 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileItemProperties.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/models/ShareFileItemProperties.java @@ -51,31 +51,4 @@ public interface ShareFileItemProperties { * @return ETag of this item. */ String getETag(); - - /** - * Gets the owner user identifier (UID) for this item. - * - * @return The owner user identifier (UID), or {@code null} if not returned by the service. - */ - default String getOwner() { - return null; - } - - /** - * Gets the owning group identifier (GID) for this item. - * - * @return The owning group identifier (GID), or {@code null} if not returned by the service. - */ - default String getGroup() { - return null; - } - - /** - * Gets the POSIX file mode for this item. - * - * @return The POSIX file mode, or {@code null} if not returned by the service. - */ - default String getFileMode() { - return null; - } } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareListFilesAndDirectoriesOptions.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareListFilesAndDirectoriesOptions.java index 0c063ab0aab90..0b5138331c401 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareListFilesAndDirectoriesOptions.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/options/ShareListFilesAndDirectoriesOptions.java @@ -14,10 +14,6 @@ public final class ShareListFilesAndDirectoriesOptions { private boolean includeAttributes; private boolean includePermissionKey; private Boolean includeExtendedInfo; - private boolean includePermissions; - private boolean includeLinkCount; - private boolean includeNfsAttributes; - private boolean includeAll; /** * Creates a new instance of {@link ShareListFilesAndDirectoriesOptions}. @@ -175,84 +171,4 @@ public ShareListFilesAndDirectoriesOptions setIncludePermissionKey(boolean inclu this.includePermissionKey = includePermissionKey; return this; } - - /** - * Gets whether to include the permissions on a listing operation. - * - * @return Whether to include the permissions on this listing operation. - */ - public boolean includePermissions() { - return includePermissions; - } - - /** - * Sets whether to include the permissions on a listing operation. - * - * @param includePermissions Whether to include the permissions on this listing operation. - * @return Updated options. - */ - public ShareListFilesAndDirectoriesOptions setIncludePermissions(boolean includePermissions) { - this.includePermissions = includePermissions; - return this; - } - - /** - * Gets whether to include NFS attributes on a listing operation. - * - * @return Whether to include NFS attributes on this listing operation. - */ - public boolean includeNfsAttributes() { - return includeNfsAttributes; - } - - /** - * Sets whether to include NFS attributes on a listing operation. - * - * @param includeNfsAttributes Whether to include NFS attributes on this listing operation. - * @return Updated options. - */ - public ShareListFilesAndDirectoriesOptions setIncludeNfsAttributes(boolean includeNfsAttributes) { - this.includeNfsAttributes = includeNfsAttributes; - return this; - } - - /** - * Gets whether to include the link count on a listing operation. - * - * @return Whether to include the link count on this listing operation. - */ - public boolean includeLinkCount() { - return includeLinkCount; - } - - /** - * Sets whether to include the link count on a listing operation. - * - * @param includeLinkCount Whether to include the link count on this listing operation. - * @return Updated options. - */ - public ShareListFilesAndDirectoriesOptions setIncludeLinkCount(boolean includeLinkCount) { - this.includeLinkCount = includeLinkCount; - return this; - } - - /** - * Gets whether to include all optional values on a listing operation. - * - * @return Whether to include all optional values on this listing operation. - */ - public boolean includeAll() { - return includeAll; - } - - /** - * Sets whether to include all optional values on a listing operation. - * - * @param includeAll Whether to include all optional values on this listing operation. - * @return Updated options. - */ - public ShareListFilesAndDirectoriesOptions setIncludeAll(boolean includeAll) { - this.includeAll = includeAll; - return this; - } } diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java index 19944f3fbb34e..6f3ff54d53ee1 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryApiTests.java @@ -36,8 +36,6 @@ import com.azure.storage.file.share.models.ShareTokenIntent; import com.azure.storage.file.share.options.ShareDirectoryCreateOptions; import com.azure.storage.file.share.options.ShareDirectorySetPropertiesOptions; -import com.azure.storage.file.share.options.ShareFileCreateOptions; -import com.azure.storage.file.share.options.ShareFileCreateSymbolicLinkOptions; import com.azure.storage.file.share.options.ShareFileRenameOptions; import com.azure.storage.file.share.options.ShareListFilesAndDirectoriesOptions; import com.azure.storage.file.share.sas.ShareFileSasPermission; @@ -917,150 +915,6 @@ public void listFilesAndDirectoriesExtendedInfoResults() { assertFalse(FileShareTestHelper.isAllWhitespace(fileListItem.getProperties().getETag())); } - @Test - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2026-12-06") - public void listFilesAndDirectoriesAllTraitsSmb() { - ShareDirectoryClient parentDir = primaryDirectoryClient; - parentDir.create(); - ShareFileClient file = parentDir.createFile(generatePathName(), Constants.KB); - ShareDirectoryClient subDir = parentDir.createSubdirectory(generatePathName()); - ShareListFilesAndDirectoriesOptions allOptions - = new ShareListFilesAndDirectoriesOptions().setIncludeExtendedInfo(true).setIncludeAll(true); - - List listResults - = parentDir.listFilesAndDirectories(allOptions, null, null).stream().collect(Collectors.toList()); - - String expectedFileName = new File(file.getFilePath()).getName(); - ShareFileItem fileItem = listResults.stream() - .filter(item -> expectedFileName.equals(item.getName())) - .findFirst() - .orElseThrow(() -> new AssertionError("Expected listed item not found: " + expectedFileName)); - - assertEquals(2, listResults.size()); - assertFalse(fileItem.isDirectory()); - assertNotNull(fileItem.getId()); - assertEquals(EnumSet.of(NtfsFileAttributes.ARCHIVE), fileItem.getFileAttributes()); - assertNotNull(fileItem.getPermissionKey()); - assertNotNull(fileItem.getProperties()); - assertNotNull(fileItem.getProperties().getCreatedOn()); - assertNotNull(fileItem.getProperties().getLastAccessedOn()); - assertNotNull(fileItem.getProperties().getLastWrittenOn()); - assertNotNull(fileItem.getProperties().getChangedOn()); - assertNotNull(fileItem.getProperties().getLastModified()); - assertNotNull(fileItem.getProperties().getETag()); - - assertNull(fileItem.getLinkCount()); - assertEquals(NfsFileType.REGULAR, fileItem.getFileType()); - assertNull(fileItem.getProperties().getOwner()); - assertNull(fileItem.getProperties().getGroup()); - assertNull(fileItem.getProperties().getFileMode()); - - String expectedDirectoryName = new File(subDir.getDirectoryPath()).getName(); - ShareFileItem dirItem = listResults.stream() - .filter(item -> expectedDirectoryName.equals(item.getName())) - .findFirst() - .orElseThrow(() -> new AssertionError("Expected listed item not found: " + expectedDirectoryName)); - assertTrue(dirItem.isDirectory()); - assertNotNull(dirItem.getId()); - assertEquals(EnumSet.of(NtfsFileAttributes.DIRECTORY), dirItem.getFileAttributes()); - assertNotNull(dirItem.getPermissionKey()); - assertNotNull(dirItem.getProperties()); - assertNotNull(dirItem.getProperties().getCreatedOn()); - assertNotNull(dirItem.getProperties().getLastAccessedOn()); - assertNotNull(dirItem.getProperties().getLastWrittenOn()); - assertNotNull(dirItem.getProperties().getChangedOn()); - assertNotNull(dirItem.getProperties().getLastModified()); - assertNotNull(dirItem.getProperties().getETag()); - - assertNull(dirItem.getLinkCount()); - assertNull(dirItem.getProperties().getOwner()); - assertNull(dirItem.getProperties().getGroup()); - assertNull(dirItem.getProperties().getFileMode()); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2026-12-06") - @Test - public void listFilesAndDirectoriesNfs() { - ShareClient premiumShareClient = getPremiumNFSShareClient(generateShareName()); - - try { - ShareDirectoryClient parent = premiumShareClient.getDirectoryClient(generatePathName()); - parent.create(); - - String owner = "345"; - String group = "123"; - String fileMode = "7777"; - FilePosixProperties posixProperties - = new FilePosixProperties().setOwner(owner).setGroup(group).setFileMode(fileMode); - - String fileName = generatePathName(); - ShareFileClient file = parent.getFileClient(fileName); - file.createWithResponse(new ShareFileCreateOptions(Constants.MB).setPosixProperties(posixProperties), null, - null); - - String subdirName = generatePathName(); - ShareDirectoryClient subdir = parent.getSubdirectoryClient(subdirName); - subdir.createWithResponse(new ShareDirectoryCreateOptions().setPosixProperties(posixProperties), null, - null); - - String symlinkName = generatePathName(); - ShareFileClient symlink = parent.getFileClient(symlinkName); - symlink.createSymbolicLinkWithResponse( - new ShareFileCreateSymbolicLinkOptions(file.getFileUrl()).setOwner(owner).setGroup(group), null, null); - - ShareListFilesAndDirectoriesOptions options - = new ShareListFilesAndDirectoriesOptions().setIncludeExtendedInfo(true) - .setIncludeTimestamps(true) - .setIncludeETag(true) - .setIncludePermissions(true) - .setIncludeLinkCount(true) - .setIncludeNfsAttributes(true); - List items - = parent.listFilesAndDirectories(options, null, null).stream().collect(Collectors.toList()); - - assertEquals(3, items.size()); - - ShareFileItem fileItem = items.stream() - .filter(item -> fileName.equals(item.getName())) - .findFirst() - .orElseThrow(() -> new AssertionError("Expected listed item not found: " + fileName)); - assertFalse(fileItem.isDirectory()); - assertEquals(NfsFileType.REGULAR, fileItem.getFileType()); - assertNotNull(fileItem.getLinkCount()); - assertNotNull(fileItem.getProperties()); - assertEquals(owner, fileItem.getProperties().getOwner()); - assertEquals(group, fileItem.getProperties().getGroup()); - assertEquals(fileMode, fileItem.getProperties().getFileMode()); - - ShareFileItem dirItem = items.stream() - .filter(item -> subdirName.equals(item.getName())) - .findFirst() - .orElseThrow(() -> new AssertionError("Expected listed item not found: " + subdirName)); - assertTrue(dirItem.isDirectory()); - assertEquals(NfsFileType.DIRECTORY, dirItem.getFileType()); - assertNotNull(dirItem.getLinkCount()); - assertNotNull(dirItem.getProperties()); - assertEquals(owner, dirItem.getProperties().getOwner()); - assertEquals(group, dirItem.getProperties().getGroup()); - assertEquals(fileMode, dirItem.getProperties().getFileMode()); - - ShareFileItem symlinkItem = items.stream() - .filter(item -> symlinkName.equals(item.getName())) - .findFirst() - .orElseThrow(() -> new AssertionError("Expected listed item not found: " + symlinkName)); - assertFalse(symlinkItem.isDirectory()); - assertEquals(NfsFileType.SYM_LINK, symlinkItem.getFileType()); - assertNotNull(symlinkItem.getLinkCount()); - assertNotNull(symlinkItem.getLinkText()); - assertFalse(FileShareTestHelper.isAllWhitespace(symlinkItem.getLinkText())); - assertNotNull(symlinkItem.getProperties()); - assertEquals(owner, symlinkItem.getProperties().getOwner()); - assertEquals(group, symlinkItem.getProperties().getGroup()); - } finally { - premiumShareClient.delete(); - } - } - @Test @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2021-12-02") public void listFilesAndDirectoriesEncoded() { diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryAsyncApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryAsyncApiTests.java index 749addc8e4b46..e4329f218fca0 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryAsyncApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryAsyncApiTests.java @@ -27,10 +27,7 @@ import com.azure.storage.file.share.models.ShareTokenIntent; import com.azure.storage.file.share.options.ShareDirectoryCreateOptions; import com.azure.storage.file.share.options.ShareDirectorySetPropertiesOptions; -import com.azure.storage.file.share.options.ShareFileCreateOptions; -import com.azure.storage.file.share.options.ShareFileCreateSymbolicLinkOptions; import com.azure.storage.file.share.options.ShareFileRenameOptions; -import com.azure.storage.file.share.options.ShareListFilesAndDirectoriesOptions; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -539,154 +536,6 @@ private static Stream listFilesAndDirectoriesArgsSupplier() { return Stream.of(Arguments.of("", null, 3), Arguments.of("", 1, 3), Arguments.of("noops", 3, 0)); } - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2026-12-06") - @Test - public void listFilesAndDirectoriesAllTraitsSmb() { - String fileName = generatePathName(); - String subdirName = generatePathName(); - Mono> listResults = primaryDirectoryAsyncClient.create() - .then(primaryDirectoryAsyncClient.createFile(fileName, Constants.KB)) - .then(primaryDirectoryAsyncClient.createSubdirectory(subdirName)) - .thenMany(primaryDirectoryAsyncClient.listFilesAndDirectories( - new ShareListFilesAndDirectoriesOptions().setIncludeExtendedInfo(true).setIncludeAll(true))) - .collectList(); - - StepVerifier.create(listResults).assertNext(items -> { - assertEquals(2, items.size()); - - ShareFileItem fileItem = items.stream() - .filter(item -> fileName.equals(item.getName())) - .findFirst() - .orElseThrow(() -> new AssertionError("Expected listed item not found: " + fileName)); - assertFalse(fileItem.isDirectory()); - assertNotNull(fileItem.getId()); - assertEquals(EnumSet.of(NtfsFileAttributes.ARCHIVE), fileItem.getFileAttributes()); - assertNotNull(fileItem.getPermissionKey()); - assertNotNull(fileItem.getProperties()); - assertNotNull(fileItem.getProperties().getCreatedOn()); - assertNotNull(fileItem.getProperties().getLastAccessedOn()); - assertNotNull(fileItem.getProperties().getLastWrittenOn()); - assertNotNull(fileItem.getProperties().getChangedOn()); - assertNotNull(fileItem.getProperties().getLastModified()); - assertNotNull(fileItem.getProperties().getETag()); - assertNull(fileItem.getLinkCount()); - assertEquals(NfsFileType.REGULAR, fileItem.getFileType()); - assertNull(fileItem.getProperties().getOwner()); - assertNull(fileItem.getProperties().getGroup()); - assertNull(fileItem.getProperties().getFileMode()); - - ShareFileItem dirItem = items.stream() - .filter(item -> subdirName.equals(item.getName())) - .findFirst() - .orElseThrow(() -> new AssertionError("Expected listed item not found: " + subdirName)); - assertTrue(dirItem.isDirectory()); - assertNotNull(dirItem.getId()); - assertEquals(EnumSet.of(NtfsFileAttributes.DIRECTORY), dirItem.getFileAttributes()); - assertNotNull(dirItem.getPermissionKey()); - assertNotNull(dirItem.getProperties()); - assertNotNull(dirItem.getProperties().getCreatedOn()); - assertNotNull(dirItem.getProperties().getLastAccessedOn()); - assertNotNull(dirItem.getProperties().getLastWrittenOn()); - assertNotNull(dirItem.getProperties().getChangedOn()); - assertNotNull(dirItem.getProperties().getLastModified()); - assertNotNull(dirItem.getProperties().getETag()); - assertNull(dirItem.getLinkCount()); - - assertNull(dirItem.getProperties().getOwner()); - assertNull(dirItem.getProperties().getGroup()); - assertNull(dirItem.getProperties().getFileMode()); - }).verifyComplete(); - } - - @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2026-12-06") - @Test - public void listFilesAndDirectoriesNfs() { - String premiumShareName = generateShareName(); - String fileName = generatePathName(); - String subdirName = generatePathName(); - String symlinkName = generatePathName(); - String owner = "345"; - String group = "123"; - String fileMode = "7777"; - - Mono> createAndList - = getPremiumNFSShareAsyncClient(premiumShareName).flatMap(premiumShareClient -> { - ShareDirectoryAsyncClient parent = premiumShareClient.getDirectoryClient(generatePathName()); - FilePosixProperties posixProperties - = new FilePosixProperties().setOwner(owner).setGroup(group).setFileMode(fileMode); - - ShareFileAsyncClient file = parent.getFileClient(fileName); - ShareDirectoryAsyncClient subdir = parent.getSubdirectoryClient(subdirName); - ShareFileAsyncClient symlink = parent.getFileClient(symlinkName); - - ShareFileCreateOptions fileOptions - = new ShareFileCreateOptions(Constants.MB).setPosixProperties(posixProperties); - ShareDirectoryCreateOptions subdirOptions - = new ShareDirectoryCreateOptions().setPosixProperties(posixProperties); - ShareFileCreateSymbolicLinkOptions symlinkOptions - = new ShareFileCreateSymbolicLinkOptions(file.getFileUrl()).setOwner(owner).setGroup(group); - ShareListFilesAndDirectoriesOptions listOptions - = new ShareListFilesAndDirectoriesOptions().setIncludeExtendedInfo(true) - .setIncludeTimestamps(true) - .setIncludeETag(true) - .setIncludePermissions(true) - .setIncludeLinkCount(true) - .setIncludeNfsAttributes(true); - - return parent.create() - .then(file.createWithResponse(fileOptions)) - .then(subdir.createWithResponse(subdirOptions)) - .then(symlink.createSymbolicLinkWithResponse(symlinkOptions)) - .thenMany(parent.listFilesAndDirectories(listOptions)) - .collectList(); - }); - - try { - StepVerifier.create(createAndList).assertNext(items -> { - assertEquals(3, items.size()); - - ShareFileItem fileItem = items.stream() - .filter(item -> fileName.equals(item.getName())) - .findFirst() - .orElseThrow(() -> new AssertionError("Expected listed item not found: " + fileName)); - assertFalse(fileItem.isDirectory()); - assertEquals(NfsFileType.REGULAR, fileItem.getFileType()); - assertNotNull(fileItem.getLinkCount()); - assertNotNull(fileItem.getProperties()); - assertEquals(owner, fileItem.getProperties().getOwner()); - assertEquals(group, fileItem.getProperties().getGroup()); - assertEquals(fileMode, fileItem.getProperties().getFileMode()); - - ShareFileItem dirItem = items.stream() - .filter(item -> subdirName.equals(item.getName())) - .findFirst() - .orElseThrow(() -> new AssertionError("Expected listed item not found: " + subdirName)); - assertTrue(dirItem.isDirectory()); - assertEquals(NfsFileType.DIRECTORY, dirItem.getFileType()); - assertNotNull(dirItem.getLinkCount()); - assertNotNull(dirItem.getProperties()); - assertEquals(owner, dirItem.getProperties().getOwner()); - assertEquals(group, dirItem.getProperties().getGroup()); - assertEquals(fileMode, dirItem.getProperties().getFileMode()); - - ShareFileItem symlinkItem = items.stream() - .filter(item -> symlinkName.equals(item.getName())) - .findFirst() - .orElseThrow(() -> new AssertionError("Expected listed item not found: " + symlinkName)); - assertFalse(symlinkItem.isDirectory()); - assertEquals(NfsFileType.SYM_LINK, symlinkItem.getFileType()); - assertNotNull(symlinkItem.getLinkCount()); - assertNotNull(symlinkItem.getLinkText()); - assertFalse(FileShareTestHelper.isAllWhitespace(symlinkItem.getLinkText())); - assertNotNull(symlinkItem.getProperties()); - assertEquals(owner, symlinkItem.getProperties().getOwner()); - assertEquals(group, symlinkItem.getProperties().getGroup()); - }).verifyComplete(); - } finally { - premiumFileServiceAsyncClient.getShareAsyncClient(premiumShareName).delete().block(); - } - } - @ParameterizedTest @MethodSource("listHandlesSupplier") public void listHandles(Integer maxResults, boolean recursive) { diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryListingDeserializationTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryListingDeserializationTests.java deleted file mode 100644 index a1e2e8df330e7..0000000000000 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/DirectoryListingDeserializationTests.java +++ /dev/null @@ -1,169 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -package com.azure.storage.file.share; - -import com.azure.core.http.HttpHeaderName; -import com.azure.core.http.HttpHeaders; -import com.azure.core.http.HttpPipeline; -import com.azure.core.http.HttpPipelineBuilder; -import com.azure.core.test.http.MockHttpResponse; -import com.azure.storage.file.share.models.NfsFileType; -import com.azure.storage.file.share.models.ShareFileItem; -import org.junit.jupiter.api.Test; -import reactor.core.publisher.Mono; - -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.nio.file.Files; -import java.nio.file.Paths; -import java.util.List; -import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.assertNull; -import static org.junit.jupiter.api.Assertions.assertTrue; - -public class DirectoryListingDeserializationTests { - private static final String LIST_FILES_AND_DIRECTORIES_RESPONSE = "testfiles/ListFilesAndDirectoriesResponse.xml"; - - @Test - public void listFilesAndDirectoriesNfsAllItemTypes() throws Exception { - String xml = readResource(LIST_FILES_AND_DIRECTORIES_RESPONSE); - HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(request -> Mono.just( - new MockHttpResponse(request, 200, new HttpHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/xml"), - xml.getBytes(StandardCharsets.UTF_8)))) - .build(); - - ShareDirectoryClient directory = new ShareFileClientBuilder().endpoint("https://account.file.core.windows.net") - .shareName("myshare") - .resourcePath("mydir") - .serviceVersion(ShareServiceVersion.V2027_03_07) - .pipeline(httpPipeline) - .buildDirectoryClient(); - - List items = directory.listFilesAndDirectories().stream().collect(Collectors.toList()); - - assertAllNfsItemTypes(items); - } - - @Test - public void listFilesAndDirectoriesNfsAllItemTypesAsync() throws Exception { - String xml = readResource(LIST_FILES_AND_DIRECTORIES_RESPONSE); - HttpPipeline httpPipeline = new HttpPipelineBuilder().httpClient(request -> Mono.just( - new MockHttpResponse(request, 200, new HttpHeaders().set(HttpHeaderName.CONTENT_TYPE, "application/xml"), - xml.getBytes(StandardCharsets.UTF_8)))) - .build(); - - ShareDirectoryAsyncClient directory - = new ShareFileClientBuilder().endpoint("https://account.file.core.windows.net") - .shareName("myshare") - .resourcePath("mydir") - .serviceVersion(ShareServiceVersion.V2027_03_07) - .pipeline(httpPipeline) - .buildDirectoryAsyncClient(); - - List items = directory.listFilesAndDirectories().collectList().block(); - - assertAllNfsItemTypes(items); - } - - private static void assertAllNfsItemTypes(List items) { - assertEquals(10, items.size()); - - ShareFileItem dir = getItemByFileType(items, NfsFileType.DIRECTORY); - assertTrue(dir.isDirectory()); - assertEquals("subdir", dir.getName()); - assertEquals("12682206919419625485", dir.getId()); - assertEquals(Long.valueOf(2), dir.getLinkCount()); - assertNull(dir.getFileSize()); - assertPosixProperties(dir, "1000", "1000", "0755"); - assertEquals("\"0x8DEAF1479E1C087\"", dir.getProperties().getETag()); - - List files = items.stream() - .filter(item -> !item.isDirectory() && item.getFileType() == NfsFileType.REGULAR) - .collect(Collectors.toList()); - assertEquals(4, files.size()); - files.forEach(file -> { - assertFalse(file.isDirectory()); - assertPosixProperties(file, "1000", "1000", "0644"); - }); - - assertListedFileItem(files.get(0), "hardlink.txt", "13835128424026472451", 80L, 2L); - assertListedFileItem(files.get(1), "regular.txt", "13835128424026472451", 80L, 2L); - assertListedFileItem(files.get(2), "regularClose.txt", "9799903157902508049", 14L, 1L); - assertListedFileItem(files.get(3), "regularOpen.txt", "17293892937847013391", 14L, 1L); - - ShareFileItem symlink = getItemByFileType(items, NfsFileType.SYM_LINK); - assertFalse(symlink.isDirectory()); - assertEquals("symlink.txt", symlink.getName()); - assertEquals("10376363910205931529", symlink.getId()); - assertEquals(Long.valueOf(1), symlink.getLinkCount()); - assertEquals("/mnt/s2/dir2/regular.txt", symlink.getLinkText()); - assertPosixProperties(symlink, "1000", "1000", "0777"); - - ShareFileItem block = getItemByFileType(items, NfsFileType.BLOCK_DEVICE); - assertEquals("block_device", block.getName()); - assertEquals("10952824662509355033", block.getId()); - assertEquals(Long.valueOf(1), block.getLinkCount()); - assertEquals(Long.valueOf(8), block.getDeviceMajor()); - assertEquals(Long.valueOf(0), block.getDeviceMinor()); - assertPosixProperties(block, "0", "0", "0640"); - - ShareFileItem charDev = getItemByFileType(items, NfsFileType.CHARACTER_DEVICE); - assertEquals("char_device", charDev.getName()); - assertEquals("16717432185543589911", charDev.getId()); - assertEquals(Long.valueOf(1), charDev.getLinkCount()); - assertEquals(Long.valueOf(1), charDev.getDeviceMajor()); - assertEquals(Long.valueOf(7), charDev.getDeviceMinor()); - assertPosixProperties(charDev, "0", "0", "0644"); - - ShareFileItem fifo = getItemByFileType(items, NfsFileType.FIFO); - assertEquals("fifo_pipe", fifo.getName()); - assertEquals("14988049928633319435", fifo.getId()); - assertEquals(Long.valueOf(1), fifo.getLinkCount()); - assertNull(fifo.getDeviceMajor()); - assertNull(fifo.getDeviceMinor()); - assertNull(fifo.getLinkText()); - assertPosixProperties(fifo, "1000", "1000", "0644"); - - ShareFileItem socket = getItemByFileType(items, NfsFileType.SOCKET); - assertEquals("unix_socket", socket.getName()); - assertEquals("16429201809391878183", socket.getId()); - assertEquals(Long.valueOf(1), socket.getLinkCount()); - assertNull(socket.getDeviceMajor()); - assertNull(socket.getDeviceMinor()); - assertNull(socket.getLinkText()); - assertPosixProperties(socket, "0", "0", "0755"); - } - - private static ShareFileItem getItemByFileType(List items, NfsFileType fileType) { - return items.stream() - .filter(item -> fileType.equals(item.getFileType())) - .findFirst() - .orElseThrow(() -> new AssertionError("Expected listed item not found for type: " + fileType)); - } - - private static void assertListedFileItem(ShareFileItem item, String name, String id, long fileSize, - long linkCount) { - assertEquals(name, item.getName()); - assertEquals(id, item.getId()); - assertEquals(Long.valueOf(fileSize), item.getFileSize()); - assertEquals(Long.valueOf(linkCount), item.getLinkCount()); - } - - private static void assertPosixProperties(ShareFileItem item, String owner, String group, String fileMode) { - assertNotNull(item.getProperties()); - assertEquals(owner, item.getProperties().getOwner()); - assertEquals(group, item.getProperties().getGroup()); - assertEquals(fileMode, item.getProperties().getFileMode()); - } - - private static String readResource(String resourceName) throws Exception { - URL resource = DirectoryListingDeserializationTests.class.getClassLoader().getResource(resourceName); - assertNotNull(resource); - return new String(Files.readAllBytes(Paths.get(resource.toURI())), StandardCharsets.UTF_8); - } -} diff --git a/sdk/storage/azure-storage-file-share/src/test/resources/testfiles/ListFilesAndDirectoriesResponse.xml b/sdk/storage/azure-storage-file-share/src/test/resources/testfiles/ListFilesAndDirectoriesResponse.xml deleted file mode 100644 index df6e051b2063a..0000000000000 --- a/sdk/storage/azure-storage-file-share/src/test/resources/testfiles/ListFilesAndDirectoriesResponse.xml +++ /dev/null @@ -1,121 +0,0 @@ - - - - - subdir - 12682206919419625485 - - 2025-10-01T00:00:00Z - 2025-10-01T00:00:00Z - 2025-10-01T00:00:00Z - 2025-10-01T00:00:00Z - Wed, 01 Oct 2025 00:00:00 GMT - "0x8DEAF1479E1C087" - 1000 - 1000 - 0755 - - 2 - - - hardlink.txt - 13835128424026472451 - - 80 - 1000 - 1000 - 0644 - - 2 - - - regular.txt - 13835128424026472451 - - 80 - 1000 - 1000 - 0644 - - 2 - - - regularClose.txt - 9799903157902508049 - - 14 - 1000 - 1000 - 0644 - - 1 - - - regularOpen.txt - 17293892937847013391 - - 14 - 1000 - 1000 - 0644 - - 1 - - - symlink.txt - 10376363910205931529 - - 1000 - 1000 - 0777 - - 1 - /mnt/s2/dir2/regular.txt - - - block_device - 10952824662509355033 - - 0 - 0 - 0640 - - 1 - 8 - 0 - - - char_device - 16717432185543589911 - - 0 - 0 - 0644 - - 1 - 1 - 7 - - - fifo_pipe - 14988049928633319435 - - 1000 - 1000 - 0644 - - 1 - - - unix_socket - 16429201809391878183 - - 0 - 0 - 0755 - - 1 - - - - diff --git a/sdk/storage/azure-storage-file-share/swagger/README.md b/sdk/storage/azure-storage-file-share/swagger/README.md index 223d605db8f0d..8a6b604a43fbf 100644 --- a/sdk/storage/azure-storage-file-share/swagger/README.md +++ b/sdk/storage/azure-storage-file-share/swagger/README.md @@ -16,7 +16,7 @@ autorest ### Code generation settings ``` yaml use: '@autorest/java@4.1.63' -input-file: https://raw.githubusercontent.com/seanmcc-msft/azure-rest-api-specs/e38b4c39072e9c00e3607cde729cea2e8d237b92/specification/storage/data-plane/Microsoft.FileStorage/stable/2026-12-06/file.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/15d7f54a5389d5906ffb4e56bb2f38fe5525c0d3/specification/storage/data-plane/Microsoft.FileStorage/stable/2026-06-06/file.json java: true output-folder: ../ namespace: com.azure.storage.file.share diff --git a/sdk/storage/azure-storage-file-share/swagger/src/main/java/ShareStorageCustomization.java b/sdk/storage/azure-storage-file-share/swagger/src/main/java/ShareStorageCustomization.java index e106aa49f0684..74f8922fbf89e 100644 --- a/sdk/storage/azure-storage-file-share/swagger/src/main/java/ShareStorageCustomization.java +++ b/sdk/storage/azure-storage-file-share/swagger/src/main/java/ShareStorageCustomization.java @@ -32,14 +32,6 @@ public void customize(LibraryCustomization customization, Logger logger) { + "that all file/directory ACLs are bypassed and full permissions are granted. User must also have " + "required RBAC permission."))); - customization.getClass("com.azure.storage.file.share.models", "NfsFileType") - .customizeAst(ast -> ast.getClassByName("NfsFileType").ifPresent(clazz -> clazz.setJavadocComment( - - "Type of the file.\n

\n" - + "This enumeration represents the type of file item in Azure Files shares. " - + "The file type is populated for all item types in both SMB and NFS-enabled shares.\n\n" - + "@see ShareFileItem#getFileType()"))); - updateImplToMapInternalException(customization.getPackage("com.azure.storage.file.share.implementation")); } From 1711153aabfa1a0b88343a06a63ff9bd2133c62a Mon Sep 17 00:00:00 2001 From: browndav Date: Thu, 1 Oct 2026 17:17:18 -0400 Subject: [PATCH 13/13] add recordings for prev features that were missing --- sdk/storage/azure-storage-file-share/assets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/azure-storage-file-share/assets.json b/sdk/storage/azure-storage-file-share/assets.json index 2096399e6a768..95f4e88276e86 100644 --- a/sdk/storage/azure-storage-file-share/assets.json +++ b/sdk/storage/azure-storage-file-share/assets.json @@ -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_1e9eb49640" + "Tag": "java/storage/azure-storage-file-share_c861318b2a" }