From 93c0e54ae346feca4b7773273493616e6ced8b44 Mon Sep 17 00:00:00 2001 From: browndav Date: Thu, 1 Oct 2026 19:25:51 -0400 Subject: [PATCH 1/9] autorest --- .../models/SharePropertiesInternal.java | 38 ++++++++++++++++ .../models/SharesGetPropertiesHeaders.java | 44 +++++++++++++++++++ .../swagger/README.md | 2 +- 3 files changed, 83 insertions(+), 1 deletion(-) diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharePropertiesInternal.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharePropertiesInternal.java index b59ff963df07d..cfac8f81b458f 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharePropertiesInternal.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharePropertiesInternal.java @@ -189,6 +189,12 @@ public final class SharePropertiesInternal implements XmlSerializable */ @@ -847,6 +853,35 @@ public SharePropertiesInternal setEnableSmbDirectoryLease(Boolean enableSmbDirec return this; } + /** + * Get the creationTime property: The CreationTime property. + * + * @return the creationTime value. + */ + @Generated + public OffsetDateTime getCreationTime() { + if (this.creationTime == null) { + return null; + } + return this.creationTime.getDateTime(); + } + + /** + * Set the creationTime property: The CreationTime property. + * + * @param creationTime the creationTime value to set. + * @return the SharePropertiesInternal object itself. + */ + @Generated + public SharePropertiesInternal setCreationTime(OffsetDateTime creationTime) { + if (creationTime == null) { + this.creationTime = null; + } else { + this.creationTime = new DateTimeRfc1123(creationTime); + } + return this; + } + /** * Get the metadata property: Dictionary of <string>. * @@ -913,6 +948,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt xmlWriter.writeStringElement("NextAllowedProvisionedBandwidthDowngradeTime", Objects.toString(this.nextAllowedProvisionedBandwidthDowngradeTime, null)); xmlWriter.writeBooleanElement("EnableSmbDirectoryLease", this.enableSmbDirectoryLease); + xmlWriter.writeStringElement("CreationTime", Objects.toString(this.creationTime, null)); if (this.metadata != null) { xmlWriter.writeStartElement("Metadata"); for (Map.Entry entry : this.metadata.entrySet()) { @@ -1028,6 +1064,8 @@ public static SharePropertiesInternal fromXml(XmlReader xmlReader, String rootEl } else if ("EnableSmbDirectoryLease".equals(elementName.getLocalPart())) { deserializedSharePropertiesInternal.enableSmbDirectoryLease = reader.getNullableElement(Boolean::parseBoolean); + } else if ("CreationTime".equals(elementName.getLocalPart())) { + deserializedSharePropertiesInternal.creationTime = reader.getNullableElement(DateTimeRfc1123::new); } else if ("Metadata".equals(elementName.getLocalPart())) { while (reader.nextElement() != XmlToken.END_ELEMENT) { if (deserializedSharePropertiesInternal.metadata == null) { 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..170908e40472c 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 @@ -148,6 +148,12 @@ public final class SharesGetPropertiesHeaders { @Generated private Boolean xMsEnableSnapshotVirtualDirectoryAccess; + /* + * The x-ms-share-creation-time property. + */ + @Generated + private DateTimeRfc1123 xMsShareCreationTime; + /* * The x-ms-share-paid-bursting-enabled property. */ @@ -236,6 +242,9 @@ public final class SharesGetPropertiesHeaders { private static final HttpHeaderName X_MS_ENABLE_SNAPSHOT_VIRTUAL_DIRECTORY_ACCESS = HttpHeaderName.fromString("x-ms-enable-snapshot-virtual-directory-access"); + private static final HttpHeaderName X_MS_SHARE_CREATION_TIME + = HttpHeaderName.fromString("x-ms-share-creation-time"); + private static final HttpHeaderName X_MS_SHARE_PAID_BURSTING_ENABLED = HttpHeaderName.fromString("x-ms-share-paid-bursting-enabled"); @@ -360,6 +369,12 @@ public SharesGetPropertiesHeaders(HttpHeaders rawHeaders) { } else { this.xMsEnableSnapshotVirtualDirectoryAccess = null; } + String xMsShareCreationTime = rawHeaders.getValue(X_MS_SHARE_CREATION_TIME); + if (xMsShareCreationTime != null) { + this.xMsShareCreationTime = new DateTimeRfc1123(xMsShareCreationTime); + } else { + this.xMsShareCreationTime = null; + } String xMsSharePaidBurstingEnabled = rawHeaders.getValue(X_MS_SHARE_PAID_BURSTING_ENABLED); if (xMsSharePaidBurstingEnabled != null) { this.xMsSharePaidBurstingEnabled = Boolean.parseBoolean(xMsSharePaidBurstingEnabled); @@ -920,6 +935,35 @@ public Boolean isXMsEnableSnapshotVirtualDirectoryAccess() { return this; } + /** + * Get the xMsShareCreationTime property: The x-ms-share-creation-time property. + * + * @return the xMsShareCreationTime value. + */ + @Generated + public OffsetDateTime getXMsShareCreationTime() { + if (this.xMsShareCreationTime == null) { + return null; + } + return this.xMsShareCreationTime.getDateTime(); + } + + /** + * Set the xMsShareCreationTime property: The x-ms-share-creation-time property. + * + * @param xMsShareCreationTime the xMsShareCreationTime value to set. + * @return the SharesGetPropertiesHeaders object itself. + */ + @Generated + public SharesGetPropertiesHeaders setXMsShareCreationTime(OffsetDateTime xMsShareCreationTime) { + if (xMsShareCreationTime == null) { + this.xMsShareCreationTime = null; + } else { + this.xMsShareCreationTime = new DateTimeRfc1123(xMsShareCreationTime); + } + return this; + } + /** * Get the xMsSharePaidBurstingEnabled property: The x-ms-share-paid-bursting-enabled property. * diff --git a/sdk/storage/azure-storage-file-share/swagger/README.md b/sdk/storage/azure-storage-file-share/swagger/README.md index 223d605db8f0d..3119fae08304f 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/8c654503a9903d3275b06a7ed426c4091cab9754/specification/storage/data-plane/Microsoft.FileStorage/stable/2027-03-07/file.json java: true output-folder: ../ namespace: com.azure.storage.file.share From bf38579d207b31dbf9cd498c1bb0d123fb7c72d7 Mon Sep 17 00:00:00 2001 From: browndav Date: Thu, 1 Oct 2026 21:57:22 -0400 Subject: [PATCH 2/9] finish feature, push assets --- .../azure-storage-file-share/assets.json | 2 +- .../implementation/util/ModelHelper.java | 2 + .../file/share/models/ShareProperties.java | 37 ++++++++++++++++++- .../azure/storage/file/share/ModelTests.java | 22 +++++++++++ .../storage/file/share/ShareApiTests.java | 8 ++++ .../file/share/ShareAsyncApiTests.java | 8 ++++ 6 files changed, 77 insertions(+), 2 deletions(-) diff --git a/sdk/storage/azure-storage-file-share/assets.json b/sdk/storage/azure-storage-file-share/assets.json index eabc0bb2c022e..48fea8f871697 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_159d5e9bd0" } 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..18437284c7d44 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 @@ -226,6 +226,7 @@ public static ShareItem populateShareItem(ShareItemInternal shareItemInternal) { */ public static ShareProperties populateShareProperties(SharePropertiesInternal sharePropertiesInternal) { ShareProperties properties = new ShareProperties(); + properties.setCreationTime(sharePropertiesInternal.getCreationTime()); properties.setLastModified(sharePropertiesInternal.getLastModified()); properties.setETag(sharePropertiesInternal.getETag()); properties.setQuota(sharePropertiesInternal.getQuota()); @@ -512,6 +513,7 @@ public static Response mapToShareInfoResponse(Response response) { mapGetPropertiesResponse(ResponseBase response) { SharesGetPropertiesHeaders headers = response.getDeserializedHeaders(); ShareProperties shareProperties = new ShareProperties().setETag(headers.getETag()) + .setCreationTime(headers.getXMsShareCreationTime()) .setLastModified(headers.getLastModified()) .setMetadata(headers.getXMsMeta()) .setQuota(headers.getXMsShareQuota()) 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..935d70942bc6c 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 @@ -25,6 +25,11 @@ */ @Fluent public final class ShareProperties implements XmlSerializable { + /* + * The creationTime property. + */ + private DateTimeRfc1123 creationTime; + /* * The lastModified property. */ @@ -174,6 +179,33 @@ public final class ShareProperties implements XmlSerializable { public ShareProperties() { } + /** + * Get the creationTime property: The creation time of the share. + * + * @return the creationTime value. + */ + public OffsetDateTime getCreationTime() { + if (this.creationTime == null) { + return null; + } + return this.creationTime.getDateTime(); + } + + /** + * Set the creationTime property: The creation time of the share. + * + * @param creationTime the creationTime value to set. + * @return the ShareProperties object itself. + */ + public ShareProperties setCreationTime(OffsetDateTime creationTime) { + if (creationTime == null) { + this.creationTime = null; + } else { + this.creationTime = new DateTimeRfc1123(creationTime); + } + return this; + } + /** * Get the lastModified property: The lastModified property. * @@ -836,6 +868,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt rootElementName = CoreUtils.isNullOrEmpty(rootElementName) ? "ShareProperties" : rootElementName; xmlWriter.writeStartElement(rootElementName); + xmlWriter.writeStringElement("CreationTime", Objects.toString(this.creationTime, null)); xmlWriter.writeStringElement("Last-Modified", Objects.toString(this.lastModified, null)); xmlWriter.writeStringElement("Etag", this.eTag); xmlWriter.writeIntElement("Quota", this.quota); @@ -897,7 +930,9 @@ public static ShareProperties fromXml(XmlReader xmlReader, String rootElementNam while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("Last-Modified".equals(elementName.getLocalPart())) { + if ("CreationTime".equals(elementName.getLocalPart())) { + deserializedShareProperties.creationTime = reader.getNullableElement(DateTimeRfc1123::new); + } else if ("Last-Modified".equals(elementName.getLocalPart())) { deserializedShareProperties.lastModified = reader.getNullableElement(DateTimeRfc1123::new); } else if ("Etag".equals(elementName.getLocalPart())) { deserializedShareProperties.eTag = reader.getStringElement(); 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..19af32e4601d6 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,11 +3,18 @@ package com.azure.storage.file.share; +import com.azure.core.http.HttpHeaders; +import com.azure.core.http.rest.ResponseBase; +import com.azure.storage.file.share.implementation.models.SharePropertiesInternal; +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 java.io.ByteArrayInputStream; +import java.time.OffsetDateTime; import java.util.EnumSet; import static org.junit.jupiter.api.Assertions.assertEquals; @@ -61,4 +68,19 @@ void uploadZeroLengthFails() { assertThrows(IllegalArgumentException.class, () -> new ShareFileUploadRangeOptions(new ByteArrayInputStream(new byte[0]), 0)); } + + @Test + void shareCreationTimeIsMappedFromResponses() { + OffsetDateTime creationTime = OffsetDateTime.parse("2026-10-01T12:00:00Z"); + ShareProperties shareProperties = new ShareProperties().setCreationTime(creationTime); + + assertEquals(creationTime, shareProperties.getCreationTime()); + assertEquals(creationTime, ModelHelper.populateShareProperties( + new SharePropertiesInternal().setCreationTime(creationTime)).getCreationTime()); + + ResponseBase response = new ResponseBase<>(null, 200, new HttpHeaders(), null, + new SharesGetPropertiesHeaders(new HttpHeaders()).setXMsShareCreationTime(creationTime) + .setXMsShareQuota(1)); + assertEquals(creationTime, ModelHelper.mapGetPropertiesResponse(response).getValue().getCreationTime()); + } } 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..73335c239fca1 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 @@ -537,6 +537,14 @@ public void getProperties() { assertEquals(1, getPropertiesResponse.getValue().getQuota()); } + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2027-03-07") + @Test + public void getPropertiesIncludesCreationTime() { + primaryShareClient.create(); + + assertNotNull(primaryShareClient.getProperties().getCreationTime()); + } + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-11-04") @Test public void getPropertiesOAuth() { 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..b415eed7208bc 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 @@ -341,6 +341,14 @@ public void getProperties() { }).verifyComplete(); } + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2027-03-07") + @Test + public void getPropertiesIncludesCreationTime() { + StepVerifier.create(primaryShareAsyncClient.create().then(primaryShareAsyncClient.getProperties())) + .assertNext(properties -> assertNotNull(properties.getCreationTime())) + .verifyComplete(); + } + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-11-04") @Test public void getPropertiesOAuth() { From 75729496b229e19a31f97d98af07ca5d1a003d6f Mon Sep 17 00:00:00 2001 From: browndav Date: Thu, 1 Oct 2026 22:52:50 -0400 Subject: [PATCH 3/9] Fix share creation time in list responses and add coverage --- sdk/storage/azure-storage-file-share/assets.json | 2 +- .../models/SharePropertiesInternal.java | 4 ++-- .../storage/file/share/FileServiceApiTests.java | 13 +++++++++++++ .../file/share/FileServiceAsyncApiTests.java | 12 ++++++++++++ .../com/azure/storage/file/share/ShareApiTests.java | 4 +++- .../storage/file/share/ShareAsyncApiTests.java | 5 ++++- .../azure-storage-file-share/swagger/README.md | 1 + 7 files changed, 36 insertions(+), 5 deletions(-) diff --git a/sdk/storage/azure-storage-file-share/assets.json b/sdk/storage/azure-storage-file-share/assets.json index 48fea8f871697..4fe23138f9b14 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_159d5e9bd0" + "Tag": "java/storage/azure-storage-file-share_2776209194" } diff --git a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharePropertiesInternal.java b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharePropertiesInternal.java index cfac8f81b458f..aa4782513a182 100644 --- a/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharePropertiesInternal.java +++ b/sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/implementation/models/SharePropertiesInternal.java @@ -948,7 +948,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt xmlWriter.writeStringElement("NextAllowedProvisionedBandwidthDowngradeTime", Objects.toString(this.nextAllowedProvisionedBandwidthDowngradeTime, null)); xmlWriter.writeBooleanElement("EnableSmbDirectoryLease", this.enableSmbDirectoryLease); - xmlWriter.writeStringElement("CreationTime", Objects.toString(this.creationTime, null)); + xmlWriter.writeStringElement("Creation-Time", Objects.toString(this.creationTime, null)); if (this.metadata != null) { xmlWriter.writeStartElement("Metadata"); for (Map.Entry entry : this.metadata.entrySet()) { @@ -1064,7 +1064,7 @@ public static SharePropertiesInternal fromXml(XmlReader xmlReader, String rootEl } else if ("EnableSmbDirectoryLease".equals(elementName.getLocalPart())) { deserializedSharePropertiesInternal.enableSmbDirectoryLease = reader.getNullableElement(Boolean::parseBoolean); - } else if ("CreationTime".equals(elementName.getLocalPart())) { + } else if ("Creation-Time".equals(elementName.getLocalPart())) { deserializedSharePropertiesInternal.creationTime = reader.getNullableElement(DateTimeRfc1123::new); } else if ("Metadata".equals(elementName.getLocalPart())) { while (reader.nextElement() != XmlToken.END_ELEMENT) { diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceApiTests.java index be1c74899980b..4c1d004705ff7 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceApiTests.java @@ -173,6 +173,19 @@ public void listSharesWithFilter(ListSharesOptions options, int limits, boolean assertTrue(includeDeleted || !shares.hasNext()); } + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2027-03-07") + @Test + public void listSharesIncludesCreationTime() { + primaryFileServiceClient.createShare(shareName); + + Iterator shares + = primaryFileServiceClient.listShares(new ListSharesOptions().setPrefix(shareName), null, null).iterator(); + assertTrue(shares.hasNext()); + ShareItem firstShare = shares.next(); + assertEquals(shareName, firstShare.getName()); + assertNotNull(firstShare.getProperties().getCreationTime()); + } + private static Stream listSharesWithFilterSupplier() { return Stream.of(Arguments.of(new ListSharesOptions(), 3, false, true, false), Arguments.of(new ListSharesOptions().setIncludeMetadata(true), 3, true, true, false), diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceAsyncApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceAsyncApiTests.java index 7f4daae7fe2b1..550e19f51d748 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceAsyncApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceAsyncApiTests.java @@ -173,6 +173,18 @@ public void listSharesWithFilter(ListSharesOptions options, int limits, boolean assertTrue(testShares.isEmpty()); } + @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2027-03-07") + @Test + public void listSharesIncludesCreationTime() { + StepVerifier.create(primaryFileServiceAsyncClient.createShare(shareName) + .thenMany(primaryFileServiceAsyncClient.listShares(new ListSharesOptions().setPrefix(shareName)))) + .assertNext(firstShare -> { + assertEquals(shareName, firstShare.getName()); + assertNotNull(firstShare.getProperties().getCreationTime()); + }) + .verifyComplete(); + } + protected static Stream listSharesWithFilterSupplier() { return Stream.of(Arguments.of(new ListSharesOptions(), 3, false, true, false), Arguments.of(new ListSharesOptions().setIncludeMetadata(true), 3, true, true, false), 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 73335c239fca1..4f83bfc51cd26 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 @@ -542,7 +542,9 @@ public void getProperties() { public void getPropertiesIncludesCreationTime() { primaryShareClient.create(); - assertNotNull(primaryShareClient.getProperties().getCreationTime()); + ShareProperties properties = primaryShareClient.getProperties(); + assertNotNull(properties.getCreationTime()); + assertNotNull(properties.getETag()); } @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2024-11-04") 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 b415eed7208bc..f79c2f6a51df5 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 @@ -345,7 +345,10 @@ public void getProperties() { @Test public void getPropertiesIncludesCreationTime() { StepVerifier.create(primaryShareAsyncClient.create().then(primaryShareAsyncClient.getProperties())) - .assertNext(properties -> assertNotNull(properties.getCreationTime())) + .assertNext(properties -> { + assertNotNull(properties.getCreationTime()); + assertNotNull(properties.getETag()); + }) .verifyComplete(); } diff --git a/sdk/storage/azure-storage-file-share/swagger/README.md b/sdk/storage/azure-storage-file-share/swagger/README.md index 3119fae08304f..5c1dc42702560 100644 --- a/sdk/storage/azure-storage-file-share/swagger/README.md +++ b/sdk/storage/azure-storage-file-share/swagger/README.md @@ -249,6 +249,7 @@ directive: $.SharePropertiesInternal.properties.Metadata = { "$ref": path }; } $.SharePropertiesInternal.properties.Etag["x-ms-client-name"] = "eTag"; + $.SharePropertiesInternal.properties.CreationTime.xml = {"name": "Creation-Time"}; ``` ### ShareUsageBytes From c1b09e6832d0face10da6651090cf0c19f10c1d6 Mon Sep 17 00:00:00 2001 From: browndav Date: Fri, 2 Oct 2026 10:31:11 -0400 Subject: [PATCH 4/9] 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 4fe23138f9b14..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_2776209194" + "Tag": "java/storage/azure-storage-file-share_679d0d8151" } From 1486b3deaaf2b4779b80c181d8df8818cc780095 Mon Sep 17 00:00:00 2001 From: browndav Date: Fri, 2 Oct 2026 10:45:27 -0400 Subject: [PATCH 5/9] spotless apply --- .../azure/storage/file/share/FileServiceAsyncApiTests.java | 5 +++-- .../test/java/com/azure/storage/file/share/ModelTests.java | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceAsyncApiTests.java b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceAsyncApiTests.java index 550e19f51d748..5203786b41cc6 100644 --- a/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceAsyncApiTests.java +++ b/sdk/storage/azure-storage-file-share/src/test/java/com/azure/storage/file/share/FileServiceAsyncApiTests.java @@ -176,8 +176,9 @@ public void listSharesWithFilter(ListSharesOptions options, int limits, boolean @RequiredServiceVersion(clazz = ShareServiceVersion.class, min = "2027-03-07") @Test public void listSharesIncludesCreationTime() { - StepVerifier.create(primaryFileServiceAsyncClient.createShare(shareName) - .thenMany(primaryFileServiceAsyncClient.listShares(new ListSharesOptions().setPrefix(shareName)))) + StepVerifier + .create(primaryFileServiceAsyncClient.createShare(shareName) + .thenMany(primaryFileServiceAsyncClient.listShares(new ListSharesOptions().setPrefix(shareName)))) .assertNext(firstShare -> { assertEquals(shareName, firstShare.getName()); assertNotNull(firstShare.getProperties().getCreationTime()); 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 19af32e4601d6..dad2c5c179224 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 @@ -75,8 +75,9 @@ void shareCreationTimeIsMappedFromResponses() { ShareProperties shareProperties = new ShareProperties().setCreationTime(creationTime); assertEquals(creationTime, shareProperties.getCreationTime()); - assertEquals(creationTime, ModelHelper.populateShareProperties( - new SharePropertiesInternal().setCreationTime(creationTime)).getCreationTime()); + assertEquals(creationTime, + ModelHelper.populateShareProperties(new SharePropertiesInternal().setCreationTime(creationTime)) + .getCreationTime()); ResponseBase response = new ResponseBase<>(null, 200, new HttpHeaders(), null, new SharesGetPropertiesHeaders(new HttpHeaders()).setXMsShareCreationTime(creationTime) From 1a58f4e5d4e92f7b5f66e14eed26ed0924036699 Mon Sep 17 00:00:00 2001 From: Isabelle Date: Sun, 11 Oct 2026 09:00:16 -0700 Subject: [PATCH 6/9] changelog entry and shareproperties serialization / deserialization schema name update --- sdk/storage/azure-storage-file-share/CHANGELOG.md | 2 ++ .../com/azure/storage/file/share/models/ShareProperties.java | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/sdk/storage/azure-storage-file-share/CHANGELOG.md b/sdk/storage/azure-storage-file-share/CHANGELOG.md index 4a0436ad7c62d..c6663995bf1e7 100644 --- a/sdk/storage/azure-storage-file-share/CHANGELOG.md +++ b/sdk/storage/azure-storage-file-share/CHANGELOG.md @@ -12,6 +12,8 @@ - Added `NfsFileType.BLOCK_DEVICE`, `NfsFileType.CHARACTER_DEVICE`, `NfsFileType.SOCKET` and `NfsFileType.FIFO`. - Added `ShareListFilesAndDirectoriesOptions.setIncludePermissions`, `setIncludeLinkCount`, `setIncludeNfsAttributes` and `setIncludeAll`. +- Added `ShareProperties.getCreationTime()` and `ShareProperties.setCreationTime(OffsetDateTime)` to expose the share + creation time returned in list and get properties responses. ### Breaking Changes 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 935d70942bc6c..3d55ab16a53c0 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 @@ -1,6 +1,5 @@ // 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; @@ -868,7 +867,7 @@ public XmlWriter toXml(XmlWriter xmlWriter, String rootElementName) throws XMLSt rootElementName = CoreUtils.isNullOrEmpty(rootElementName) ? "ShareProperties" : rootElementName; xmlWriter.writeStartElement(rootElementName); - xmlWriter.writeStringElement("CreationTime", Objects.toString(this.creationTime, null)); + xmlWriter.writeStringElement("Creation-Time", Objects.toString(this.creationTime, null)); xmlWriter.writeStringElement("Last-Modified", Objects.toString(this.lastModified, null)); xmlWriter.writeStringElement("Etag", this.eTag); xmlWriter.writeIntElement("Quota", this.quota); @@ -930,7 +929,7 @@ public static ShareProperties fromXml(XmlReader xmlReader, String rootElementNam while (reader.nextElement() != XmlToken.END_ELEMENT) { QName elementName = reader.getElementName(); - if ("CreationTime".equals(elementName.getLocalPart())) { + if ("Creation-Time".equals(elementName.getLocalPart())) { deserializedShareProperties.creationTime = reader.getNullableElement(DateTimeRfc1123::new); } else if ("Last-Modified".equals(elementName.getLocalPart())) { deserializedShareProperties.lastModified = reader.getNullableElement(DateTimeRfc1123::new); From a42179d80e17ba73f69870b4151b3af945c1d12e Mon Sep 17 00:00:00 2001 From: browndav Date: Tue, 13 Oct 2026 13:58:53 -0400 Subject: [PATCH 7/9] 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 8/9] 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" } From 03ac93b838e2df457ace75fa9bafeae84dfdbb15 Mon Sep 17 00:00:00 2001 From: browndav Date: Thu, 15 Oct 2026 13:02:36 -0400 Subject: [PATCH 9/9] Update File Share Swagger spec reference --- sdk/storage/azure-storage-file-share/swagger/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/storage/azure-storage-file-share/swagger/README.md b/sdk/storage/azure-storage-file-share/swagger/README.md index 5c1dc42702560..aad699d839edc 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/browndav-msft/azure-rest-api-specs/8c654503a9903d3275b06a7ed426c4091cab9754/specification/storage/data-plane/Microsoft.FileStorage/stable/2027-03-07/file.json +input-file: https://raw.githubusercontent.com/browndav-msft/azure-rest-api-specs/b6915c1d71519f3e720def065c4710bd96385d25/specification/storage/data-plane/Microsoft.FileStorage/stable/2027-03-07/file.json java: true output-folder: ../ namespace: com.azure.storage.file.share