Skip to content

Commit dd1696b

Browse files
STG97 Beta Features (Azure#44043)
* versioning changes for stg97 (Azure#43030) * versioning changes for stg97 * removing assets file changes --------- Co-authored-by: Isabelle <[email protected]> * STG97 - NFS over REST (Azure#43112) * wip * temporary fix for FilesCreateHardLinkHeaders * adding javadocs, and preparing for api review * removing unused imports * removing breaking change from ShareDirectory and adding accessor pattern * changing nfs to posix and refactoring some client methods * removing breaking changes from ShareDirectoryProperties, ShareFileInfo, and ShareFileProperties * making NfsFileType a custom type * addressing api review comments * fixing documentation errors * addressing linting report * using deprecated HttpHeaders.getValue(String) in FilePosixProperties to prevent having to move it to the com.azure.storage.file.share package * adjusting default value in FilePosixProperties * fixing spotbugs issue * adding try catch to hopefully resolve spotbugs issue * still trying to address spotbugs issue * addressing spotbugs issue * adding ModeCopyMode and OwnerCopyMode to copy file options * addressing comments * removing unused imports and changing files classes to use lambda expressions for access helpers * adding new recordings and editing old ones * addressing comments * fixing style * fixing style and updating recording for getPropertiesOAuth * changing customization for FilesCreateHardLinkHeaders, style, changelog edit * removing leftover customization --------- Co-authored-by: gunjansingh-msft <[email protected]>
1 parent 3e6d977 commit dd1696b

File tree

58 files changed

+5797
-601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+5797
-601
lines changed

sdk/storage/azure-storage-blob/src/main/java/com/azure/storage/blob/BlobServiceVersion.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,12 @@ public enum BlobServiceVersion implements ServiceVersion {
132132
/**
133133
* Service version {@code 2025-01-05}.
134134
*/
135-
V2025_01_05("2025-01-05");
135+
V2025_01_05("2025-01-05"),
136+
137+
/**
138+
* Service version {@code 2025-05-05}.
139+
*/
140+
V2025_05_05("2025-05-05");
136141

137142
private final String version;
138143

@@ -154,6 +159,6 @@ public String getVersion() {
154159
* @return the latest {@link BlobServiceVersion}
155160
*/
156161
public static BlobServiceVersion getLatest() {
157-
return V2025_01_05;
162+
return V2025_05_05;
158163
}
159164
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
AZURE_LIVE_TEST_SERVICE_VERSION=V2025_01_05
2-
AZURE_STORAGE_SAS_SERVICE_VERSION=2025-01-05
1+
AZURE_LIVE_TEST_SERVICE_VERSION=V2025_05_05
2+
AZURE_STORAGE_SAS_SERVICE_VERSION=2025-05-05

sdk/storage/azure-storage-common/src/main/java/com/azure/storage/common/implementation/Constants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ public final class Constants {
8888
public static final String PROPERTY_AZURE_STORAGE_SAS_SERVICE_VERSION = "AZURE_STORAGE_SAS_SERVICE_VERSION";
8989

9090
public static final String SAS_SERVICE_VERSION
91-
= Configuration.getGlobalConfiguration().get(PROPERTY_AZURE_STORAGE_SAS_SERVICE_VERSION, "2025-01-05");
91+
= Configuration.getGlobalConfiguration().get(PROPERTY_AZURE_STORAGE_SAS_SERVICE_VERSION, "2025-05-05");
9292

9393
public static final String ADJUSTED_BLOB_LENGTH_KEY = "adjustedBlobLength";
9494

@@ -218,7 +218,7 @@ public static final class HeaderConstants {
218218
* @deprecated For SAS Service Version use {@link Constants#SAS_SERVICE_VERSION}.
219219
*/
220220
@Deprecated
221-
public static final String TARGET_STORAGE_VERSION = "2025-01-05";
221+
public static final String TARGET_STORAGE_VERSION = "2025-05-05";
222222

223223
/**
224224
* Error code returned from the service.

sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeServiceVersion.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,12 @@ public enum DataLakeServiceVersion implements ServiceVersion {
132132
/**
133133
* Service version {@code 2025-01-05}.
134134
*/
135-
V2025_01_05("2025-01-05");
135+
V2025_01_05("2025-01-05"),
136+
137+
/**
138+
* Service version {@code 2025-05-05}.
139+
*/
140+
V2025_05_05("2025-05-05");
136141

137142
private final String version;
138143

@@ -154,6 +159,6 @@ public String getVersion() {
154159
* @return the latest {@link DataLakeServiceVersion}
155160
*/
156161
public static DataLakeServiceVersion getLatest() {
157-
return V2025_01_05;
162+
return V2025_05_05;
158163
}
159164
}

sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/implementation/util/TransformUtils.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ public static BlobServiceVersion toBlobServiceVersion(DataLakeServiceVersion ver
6262
return BlobServiceVersion.V2024_11_04;
6363
} else if (DataLakeServiceVersion.V2025_01_05.ordinal() == version.ordinal()) {
6464
return BlobServiceVersion.V2025_01_05;
65+
} else if (DataLakeServiceVersion.V2025_05_05.ordinal() == version.ordinal()) {
66+
return BlobServiceVersion.V2025_05_05;
6567
}
6668

6769
return null;

sdk/storage/azure-storage-file-share/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,15 @@
33
## 12.26.0-beta.1 (Unreleased)
44

55
### Features Added
6+
- Added support for NFS over REST.
67

78
### Breaking Changes
9+
- The following APIs no longer send the x-ms-file-permission, x-ms-file-attributes, x-ms-file-creation-time, and x-ms-file-last-write-time request headers by default. These headers have been optional in the REST API since x-ms-version 2021-06-08:
10+
- ShareDirectoryClient/ShareDirectoryAsyncClient.createWithResponse()
11+
- ShareDirectoryClient/ShareDirectoryAsyncClient.setPropertiesWithResponse()
12+
- ShareFileClient/ShareFileAsyncClient.createWithResponse()
13+
- ShareFileClient/ShareFileAsyncClient.beginCopy()
14+
- ShareFileClient/ShareFileAsyncClient.setPropertiesWithResponse()
815

916
### Bugs Fixed
1017

sdk/storage/azure-storage-file-share/assets.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
"AssetsRepo": "Azure/azure-sdk-assets",
33
"AssetsRepoPrefixPath": "java",
44
"TagPrefix": "java/storage/azure-storage-file-share",
5-
"Tag": "java/storage/azure-storage-file-share_1ec39c35ed"
5+
"Tag": "java/storage/azure-storage-file-share_793c5e10e5"
66
}

sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/FileSmbProperties.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,33 @@ String getFileChangeTimeString() {
202202
return fileChangeTime == null ? null : parseFileSMBDate(fileChangeTime);
203203
}
204204

205+
/**
206+
* Gets the string representation of the file's {@link NtfsFileAttributes} or null if no value is set.
207+
*
208+
* @return The value of the file's {@link NtfsFileAttributes}.
209+
*/
210+
String getNtfsFileAttributesString() {
211+
return ntfsFileAttributes == null ? null : NtfsFileAttributes.toString(ntfsFileAttributes);
212+
}
213+
214+
/**
215+
* Gets the string representation of the file's creation time or null if no value is set.
216+
*
217+
* @return The value of the file's creation time.
218+
*/
219+
String getFileCreationTimeString() {
220+
return fileCreationTime == null ? null : parseFileSMBDate(fileCreationTime);
221+
}
222+
223+
/**
224+
* Gets the string representation of the file's last write time or null if no value is set.
225+
*
226+
* @return The value of the file's last write time.
227+
*/
228+
String getFileLastWriteTimeString() {
229+
return fileLastWriteTime == null ? null : parseFileSMBDate(fileLastWriteTime);
230+
}
231+
205232
/**
206233
* Given an <code>OffsetDateTime</code>, generates a {@code String} representing a date in the format needed for
207234
* file SMB properties

sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareAsyncClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1693,8 +1693,8 @@ Mono<Response<ShareFileAsyncClient>> createFileWithResponse(String fileName, lon
16931693
Map<String, String> metadata, ShareRequestConditions requestConditions, Context context) {
16941694
ShareFileAsyncClient shareFileAsyncClient = getFileClient(fileName);
16951695
return shareFileAsyncClient
1696-
.createWithResponse(maxSize, httpHeaders, smbProperties, filePermission, null, metadata, requestConditions,
1697-
context)
1696+
.createWithResponse(maxSize, httpHeaders, smbProperties, filePermission, null, null, metadata,
1697+
requestConditions, context)
16981698
.map(response -> new SimpleResponse<>(response, shareFileAsyncClient));
16991699
}
17001700

sdk/storage/azure-storage-file-share/src/main/java/com/azure/storage/file/share/ShareDirectoryAsyncClient.java

Lines changed: 45 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
import com.azure.storage.file.share.implementation.util.ShareSasImplUtil;
3232
import com.azure.storage.file.share.models.CloseHandlesInfo;
3333
import com.azure.storage.file.share.models.FilePermissionFormat;
34+
import com.azure.storage.file.share.models.FilePosixProperties;
3435
import com.azure.storage.file.share.models.HandleItem;
3536
import com.azure.storage.file.share.models.NtfsFileAttributes;
3637
import com.azure.storage.file.share.models.ShareDirectoryInfo;
@@ -39,6 +40,7 @@
3940
import com.azure.storage.file.share.models.ShareErrorCode;
4041
import com.azure.storage.file.share.models.ShareFileHttpHeaders;
4142
import com.azure.storage.file.share.models.ShareFileItem;
43+
import com.azure.storage.file.share.models.ShareFilePermission;
4244
import com.azure.storage.file.share.models.ShareRequestConditions;
4345
import com.azure.storage.file.share.models.ShareStorageException;
4446
import com.azure.storage.file.share.options.ShareDirectoryCreateOptions;
@@ -310,7 +312,8 @@ public Mono<ShareDirectoryInfo> create() {
310312
public Mono<Response<ShareDirectoryInfo>> createWithResponse(FileSmbProperties smbProperties, String filePermission,
311313
Map<String, String> metadata) {
312314
try {
313-
return withContext(context -> createWithResponse(smbProperties, filePermission, null, metadata, context));
315+
return withContext(
316+
context -> createWithResponse(smbProperties, filePermission, null, null, metadata, context));
314317
} catch (RuntimeException ex) {
315318
return monoError(LOGGER, ex);
316319
}
@@ -350,32 +353,28 @@ public Mono<Response<ShareDirectoryInfo>> createWithResponse(FileSmbProperties s
350353
public Mono<Response<ShareDirectoryInfo>> createWithResponse(ShareDirectoryCreateOptions options) {
351354
try {
352355
return withContext(context -> createWithResponse(options.getSmbProperties(), options.getFilePermission(),
353-
options.getFilePermissionFormat(), options.getMetadata(), context));
356+
options.getFilePermissionFormat(), options.getPosixProperties(), options.getMetadata(), context));
354357
} catch (RuntimeException ex) {
355358
return monoError(LOGGER, ex);
356359
}
357360
}
358361

359362
Mono<Response<ShareDirectoryInfo>> createWithResponse(FileSmbProperties smbProperties, String filePermission,
360-
FilePermissionFormat filePermissionFormat, Map<String, String> metadata, Context context) {
361-
FileSmbProperties properties = smbProperties == null ? new FileSmbProperties() : smbProperties;
363+
FilePermissionFormat filePermissionFormat, FilePosixProperties posixProperties, Map<String, String> metadata,
364+
Context context) {
365+
context = context == null ? Context.NONE : context;
366+
smbProperties = smbProperties == null ? new FileSmbProperties() : smbProperties;
367+
posixProperties = posixProperties == null ? new FilePosixProperties() : posixProperties;
362368

363369
// Checks that file permission and file permission key are valid
364-
ModelHelper.validateFilePermissionAndKey(filePermission, properties.getFilePermissionKey());
365-
366-
// If file permission and file permission key are both not set then set default value
367-
filePermission = properties.setFilePermission(filePermission, FileConstants.FILE_PERMISSION_INHERIT);
368-
String filePermissionKey = properties.getFilePermissionKey();
369-
370-
String fileAttributes = properties.setNtfsFileAttributes(FileConstants.FILE_ATTRIBUTES_NONE);
371-
String fileCreationTime = properties.setFileCreationTime(FileConstants.FILE_TIME_NOW);
372-
String fileLastWriteTime = properties.setFileLastWriteTime(FileConstants.FILE_TIME_NOW);
373-
String fileChangeTime = properties.getFileChangeTimeString();
374-
context = context == null ? Context.NONE : context;
370+
ModelHelper.validateFilePermissionAndKey(filePermission, smbProperties.getFilePermissionKey());
375371

376372
return azureFileStorageClient.getDirectories()
377-
.createWithResponseAsync(shareName, directoryPath, fileAttributes, null, metadata, filePermission,
378-
filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, context)
373+
.createWithResponseAsync(shareName, directoryPath, null, metadata, filePermission, filePermissionFormat,
374+
smbProperties.getFilePermissionKey(), smbProperties.getNtfsFileAttributesString(),
375+
smbProperties.getFileCreationTimeString(), smbProperties.getFileLastWriteTimeString(),
376+
smbProperties.getFileChangeTimeString(), posixProperties.getOwner(), posixProperties.getGroup(),
377+
posixProperties.getFileMode(), context)
379378
.map(ModelHelper::mapShareDirectoryInfo);
380379
}
381380

@@ -455,14 +454,15 @@ Mono<Response<ShareDirectoryInfo>> createIfNotExistsWithResponse(ShareDirectoryC
455454
Context context) {
456455
try {
457456
options = options == null ? new ShareDirectoryCreateOptions() : options;
458-
return createWithResponse(options.getSmbProperties(), options.getFilePermission(), null,
459-
options.getMetadata(), context).onErrorResume(
460-
t -> t instanceof ShareStorageException && ((ShareStorageException) t).getStatusCode() == 409,
461-
t -> {
462-
HttpResponse response = ((ShareStorageException) t).getResponse();
463-
return Mono.just(new SimpleResponse<>(response.getRequest(), response.getStatusCode(),
464-
response.getHeaders(), null));
465-
});
457+
return createWithResponse(options.getSmbProperties(), options.getFilePermission(),
458+
options.getFilePermissionFormat(), options.getPosixProperties(), options.getMetadata(), context)
459+
.onErrorResume(
460+
t -> t instanceof ShareStorageException && ((ShareStorageException) t).getStatusCode() == 409,
461+
t -> {
462+
HttpResponse response = ((ShareStorageException) t).getResponse();
463+
return Mono.just(new SimpleResponse<>(response.getRequest(), response.getStatusCode(),
464+
response.getHeaders(), null));
465+
});
466466
} catch (RuntimeException ex) {
467467
return monoError(LOGGER, ex);
468468
}
@@ -729,7 +729,8 @@ public Mono<ShareDirectoryInfo> setProperties(FileSmbProperties smbProperties, S
729729
public Mono<Response<ShareDirectoryInfo>> setPropertiesWithResponse(FileSmbProperties smbProperties,
730730
String filePermission) {
731731
try {
732-
return withContext(context -> setPropertiesWithResponse(smbProperties, filePermission, null, context));
732+
return withContext(
733+
context -> setPropertiesWithResponse(smbProperties, filePermission, null, null, context));
733734
} catch (RuntimeException ex) {
734735
return monoError(LOGGER, ex);
735736
}
@@ -763,35 +764,31 @@ public Mono<Response<ShareDirectoryInfo>> setPropertiesWithResponse(FileSmbPrope
763764
@ServiceMethod(returns = ReturnType.SINGLE)
764765
public Mono<Response<ShareDirectoryInfo>> setPropertiesWithResponse(ShareDirectorySetPropertiesOptions options) {
765766
try {
766-
return withContext(context -> setPropertiesWithResponse(options.getSmbProperties(),
767-
options.getFilePermissions().getPermission(), options.getFilePermissions().getPermissionFormat(),
768-
context));
767+
ShareFilePermission filePermission
768+
= options.getFilePermissions() == null ? new ShareFilePermission() : options.getFilePermissions();
769+
return withContext(
770+
context -> setPropertiesWithResponse(options.getSmbProperties(), filePermission.getPermission(),
771+
filePermission.getPermissionFormat(), options.getPosixProperties(), context));
769772
} catch (RuntimeException ex) {
770773
return monoError(LOGGER, ex);
771774
}
772775
}
773776

774777
Mono<Response<ShareDirectoryInfo>> setPropertiesWithResponse(FileSmbProperties smbProperties, String filePermission,
775-
FilePermissionFormat filePermissionFormat, Context context) {
776-
777-
FileSmbProperties properties = smbProperties == null ? new FileSmbProperties() : smbProperties;
778+
FilePermissionFormat filePermissionFormat, FilePosixProperties posixProperties, Context context) {
779+
context = context == null ? Context.NONE : context;
780+
smbProperties = smbProperties == null ? new FileSmbProperties() : smbProperties;
781+
posixProperties = posixProperties == null ? new FilePosixProperties() : posixProperties;
778782

779783
// Checks that file permission and file permission key are valid
780-
ModelHelper.validateFilePermissionAndKey(filePermission, properties.getFilePermissionKey());
784+
ModelHelper.validateFilePermissionAndKey(filePermission, smbProperties.getFilePermissionKey());
781785

782-
// If file permission and file permission key are both not set then set default value
783-
filePermission = properties.setFilePermission(filePermission, FileConstants.PRESERVE);
784-
String filePermissionKey = properties.getFilePermissionKey();
785-
786-
String fileAttributes = properties.setNtfsFileAttributes(FileConstants.PRESERVE);
787-
String fileCreationTime = properties.setFileCreationTime(FileConstants.PRESERVE);
788-
String fileLastWriteTime = properties.setFileLastWriteTime(FileConstants.PRESERVE);
789-
String fileChangeTime = properties.getFileChangeTimeString();
790-
791-
context = context == null ? Context.NONE : context;
792786
return azureFileStorageClient.getDirectories()
793-
.setPropertiesWithResponseAsync(shareName, directoryPath, fileAttributes, null, filePermission,
794-
filePermissionFormat, filePermissionKey, fileCreationTime, fileLastWriteTime, fileChangeTime, context)
787+
.setPropertiesWithResponseAsync(shareName, directoryPath, null, filePermission, filePermissionFormat,
788+
smbProperties.getFilePermissionKey(), smbProperties.getNtfsFileAttributesString(),
789+
smbProperties.getFileCreationTimeString(), smbProperties.getFileLastWriteTimeString(),
790+
smbProperties.getFileChangeTimeString(), posixProperties.getOwner(), posixProperties.getGroup(),
791+
posixProperties.getFileMode(), context)
795792
.map(ModelHelper::mapSetPropertiesResponse);
796793
}
797794

@@ -1388,7 +1385,7 @@ public Mono<Response<ShareDirectoryAsyncClient>> createSubdirectoryWithResponse(
13881385
Mono<Response<ShareDirectoryAsyncClient>> createSubdirectoryWithResponse(String subdirectoryName,
13891386
FileSmbProperties smbProperties, String filePermission, Map<String, String> metadata, Context context) {
13901387
ShareDirectoryAsyncClient createSubClient = getSubdirectoryClient(subdirectoryName);
1391-
return createSubClient.createWithResponse(smbProperties, filePermission, null, metadata, context)
1388+
return createSubClient.createWithResponse(smbProperties, filePermission, null, null, metadata, context)
13921389
.map(response -> new SimpleResponse<>(response, createSubClient));
13931390
}
13941391

@@ -1774,8 +1771,8 @@ Mono<Response<ShareFileAsyncClient>> createFileWithResponse(String fileName, lon
17741771
Map<String, String> metadata, ShareRequestConditions requestConditions, Context context) {
17751772
ShareFileAsyncClient shareFileAsyncClient = getFileClient(fileName);
17761773
return shareFileAsyncClient
1777-
.createWithResponse(maxSize, httpHeaders, smbProperties, filePermission, null, metadata, requestConditions,
1778-
context)
1774+
.createWithResponse(maxSize, httpHeaders, smbProperties, filePermission, null, null, metadata,
1775+
requestConditions, context)
17791776
.map(response -> new SimpleResponse<>(response, shareFileAsyncClient));
17801777
}
17811778

0 commit comments

Comments
 (0)