Skip to content

Commit a2336de

Browse files
authored
More GA Changes (Azure#40160)
* changes * readtofileoptions md5 boolean -> Boolean
1 parent f02a120 commit a2336de

File tree

8 files changed

+28
-33
lines changed

8 files changed

+28
-33
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1477,7 +1477,7 @@ public Mono<PathProperties> readToFile(String filePath) {
14771477
*
14781478
* <!-- src_embed com.azure.storage.file.datalake.DataLakeFileAsyncClient.readToFile#ReadToFileOptions -->
14791479
* <pre>
1480-
* client.readToFile&#40;new ReadToFileOptions&#40;&#41;.setFilePath&#40;file&#41;&#41;
1480+
* client.readToFile&#40;new ReadToFileOptions&#40;file&#41;&#41;
14811481
* .subscribe&#40;response -&gt; System.out.println&#40;&quot;Completed download to file&quot;&#41;&#41;;
14821482
* </pre>
14831483
* <!-- end com.azure.storage.file.datalake.DataLakeFileAsyncClient.readToFile#ReadToFileOptions -->
@@ -1590,8 +1590,7 @@ public Mono<Response<PathProperties>> readToFileWithResponse(String filePath, Fi
15901590
*
15911591
* <!-- src_embed com.azure.storage.file.datalake.DataLakeFileAsyncClient.readToFileWithResponse#ReadToFileOptions -->
15921592
* <pre>
1593-
* ReadToFileOptions options = new ReadToFileOptions&#40;&#41;;
1594-
* options.setFilePath&#40;file&#41;;
1593+
* ReadToFileOptions options = new ReadToFileOptions&#40;file&#41;;
15951594
* options.setRange&#40;new FileRange&#40;1024, 2048L&#41;&#41;;
15961595
* options.setDownloadRetryOptions&#40;new DownloadRetryOptions&#40;&#41;.setMaxRetryRequests&#40;5&#41;&#41;;
15971596
* options.setOpenOptions&#40;new HashSet&lt;&gt;&#40;Arrays.asList&#40;StandardOpenOption.CREATE_NEW,

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ public PathProperties readToFile(String filePath) {
12261226
*
12271227
* <!-- src_embed com.azure.storage.file.datalake.DataLakeFileClient.readToFile#ReadToFileOptions -->
12281228
* <pre>
1229-
* client.readToFile&#40;new ReadToFileOptions&#40;&#41;.setFilePath&#40;file&#41;&#41;;
1229+
* client.readToFile&#40;new ReadToFileOptions&#40;file&#41;&#41;;
12301230
* System.out.println&#40;&quot;Completed download to file&quot;&#41;;
12311231
* </pre>
12321232
* <!-- end com.azure.storage.file.datalake.DataLakeFileClient.readToFile#ReadToFileOptions -->
@@ -1348,8 +1348,7 @@ public Response<PathProperties> readToFileWithResponse(String filePath, FileRang
13481348
*
13491349
* <!-- src_embed com.azure.storage.file.datalake.DataLakeFileClient.readToFileWithResponse#ReadToFileOptions-Duration-Context -->
13501350
* <pre>
1351-
* ReadToFileOptions options = new ReadToFileOptions&#40;&#41;;
1352-
* options.setFilePath&#40;file&#41;;
1351+
* ReadToFileOptions options = new ReadToFileOptions&#40;file&#41;;
13531352
* options.setRange&#40;new FileRange&#40;1024, 2048L&#41;&#41;;
13541353
* options.setDownloadRetryOptions&#40;new DownloadRetryOptions&#40;&#41;.setMaxRetryRequests&#40;5&#41;&#41;;
13551354
* options.setOpenOptions&#40;new HashSet&lt;&gt;&#40;Arrays.asList&#40;StandardOpenOption.CREATE_NEW,

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

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package com.azure.storage.file.datalake.options;
55

66
import com.azure.storage.common.ParallelTransferOptions;
7+
import com.azure.storage.common.implementation.StorageImplUtils;
78
import com.azure.storage.file.datalake.DataLakeFileClient;
89
import com.azure.storage.file.datalake.models.DataLakeRequestConditions;
910
import com.azure.storage.file.datalake.models.DownloadRetryOptions;
@@ -18,29 +19,30 @@
1819
* Parameters when calling readToFile() on {@link DataLakeFileClient}
1920
*/
2021
public class ReadToFileOptions {
21-
private String filePath;
22+
private final String filePath;
2223
private FileRange range;
2324
private ParallelTransferOptions parallelTransferOptions;
2425
private DownloadRetryOptions downloadRetryOptions;
2526
private DataLakeRequestConditions dataLakeRequestConditions;
26-
private boolean rangeGetContentMd5;
27+
private Boolean rangeGetContentMd5;
2728
private Set<OpenOption> openOptions;
2829
private Boolean userPrincipalName;
2930

3031
/**
31-
* @return A {@link String} representing the filePath where the downloaded data will be written.
32+
* Constructs a {@link ReadToFileOptions}.
33+
*
34+
* @param filePath Path of the file to download to.
3235
*/
33-
public String getFilePath() {
34-
return filePath;
36+
public ReadToFileOptions(String filePath) {
37+
StorageImplUtils.assertNotNull("filePath", filePath);
38+
this.filePath = filePath;
3539
}
3640

3741
/**
38-
* @param filePath A {@link String} representing the filePath where the downloaded data will be written.
39-
* @return The updated options.
42+
* @return A {@link String} representing the filePath where the downloaded data will be written.
4043
*/
41-
public ReadToFileOptions setFilePath(String filePath) {
42-
this.filePath = filePath;
43-
return this;
44+
public String getFilePath() {
45+
return filePath;
4446
}
4547

4648
/**
@@ -113,15 +115,15 @@ public ReadToFileOptions setDataLakeRequestConditions(DataLakeRequestConditions
113115
/**
114116
* @return Whether the contentMD5 for the specified file range should be returned.
115117
*/
116-
public boolean isRangeGetContentMd5() {
118+
public Boolean isRangeGetContentMd5() {
117119
return rangeGetContentMd5;
118120
}
119121

120122
/**
121123
* @param rangeGetContentMd5 Whether the contentMD5 for the specified file range should be returned.
122124
* @return The updated options.
123125
*/
124-
public ReadToFileOptions setRangeGetContentMd5(boolean rangeGetContentMd5) {
126+
public ReadToFileOptions setRangeGetContentMd5(Boolean rangeGetContentMd5) {
125127
this.rangeGetContentMd5 = rangeGetContentMd5;
126128
return this;
127129
}

sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/DataLakeFileAsyncClientJavaDocSamples.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public void downloadToFileCodeSnippet() {
143143
// END: com.azure.storage.file.datalake.DataLakeFileAsyncClient.readToFile#String
144144

145145
// BEGIN: com.azure.storage.file.datalake.DataLakeFileAsyncClient.readToFile#ReadToFileOptions
146-
client.readToFile(new ReadToFileOptions().setFilePath(file))
146+
client.readToFile(new ReadToFileOptions(file))
147147
.subscribe(response -> System.out.println("Completed download to file"));
148148
// END: com.azure.storage.file.datalake.DataLakeFileAsyncClient.readToFile#ReadToFileOptions
149149

@@ -163,8 +163,7 @@ public void downloadToFileCodeSnippet() {
163163
// END: com.azure.storage.file.datalake.DataLakeFileAsyncClient.readToFileWithResponse#String-FileRange-ParallelTransferOptions-DownloadRetryOptions-DataLakeRequestConditions-boolean-Set
164164

165165
// BEGIN: com.azure.storage.file.datalake.DataLakeFileAsyncClient.readToFileWithResponse#ReadToFileOptions
166-
ReadToFileOptions options = new ReadToFileOptions();
167-
options.setFilePath(file);
166+
ReadToFileOptions options = new ReadToFileOptions(file);
168167
options.setRange(new FileRange(1024, 2048L));
169168
options.setDownloadRetryOptions(new DownloadRetryOptions().setMaxRetryRequests(5));
170169
options.setOpenOptions(new HashSet<>(Arrays.asList(StandardOpenOption.CREATE_NEW,

sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/DataLakeFileClientJavaDocSamples.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public void downloadToFile() {
143143
// END: com.azure.storage.file.datalake.DataLakeFileClient.readToFile#String
144144

145145
// BEGIN: com.azure.storage.file.datalake.DataLakeFileClient.readToFile#ReadToFileOptions
146-
client.readToFile(new ReadToFileOptions().setFilePath(file));
146+
client.readToFile(new ReadToFileOptions(file));
147147
System.out.println("Completed download to file");
148148
// END: com.azure.storage.file.datalake.DataLakeFileClient.readToFile#ReadToFileOptions
149149

@@ -165,8 +165,7 @@ public void downloadToFile() {
165165
// END: com.azure.storage.file.datalake.DataLakeFileClient.readToFileWithResponse#String-FileRange-ParallelTransferOptions-DownloadRetryOptions-DataLakeRequestConditions-boolean-Set-Duration-Context
166166

167167
// BEGIN: com.azure.storage.file.datalake.DataLakeFileClient.readToFileWithResponse#ReadToFileOptions-Duration-Context
168-
ReadToFileOptions options = new ReadToFileOptions();
169-
options.setFilePath(file);
168+
ReadToFileOptions options = new ReadToFileOptions(file);
170169
options.setRange(new FileRange(1024, 2048L));
171170
options.setDownloadRetryOptions(new DownloadRetryOptions().setMaxRetryRequests(5));
172171
options.setOpenOptions(new HashSet<>(Arrays.asList(StandardOpenOption.CREATE_NEW,

sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileApiTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3473,9 +3473,9 @@ public void upnHeaderTest(Boolean upnHeader) {
34733473
if (outFile.exists()) {
34743474
assertTrue(outFile.delete());
34753475
}
3476-
ReadToFileOptions readToFileOptions = new ReadToFileOptions();
3477-
readToFileOptions.setUserPrincipalName(upnHeader).setFilePath(outFile.getPath()).setRange(null)
3478-
.setParallelTransferOptions(null).setDownloadRetryOptions(null).setDataLakeRequestConditions(null)
3476+
ReadToFileOptions readToFileOptions = new ReadToFileOptions(outFile.getPath());
3477+
readToFileOptions.setUserPrincipalName(upnHeader).setRange(null).setParallelTransferOptions(null)
3478+
.setDownloadRetryOptions(null).setDataLakeRequestConditions(null)
34793479
.setRangeGetContentMd5(false).setOpenOptions(null);
34803480

34813481
PathProperties readToFileResponse = fc.readToFile(readToFileOptions);

sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileAsyncApiTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4692,9 +4692,9 @@ public void upnHeaderTest(Boolean upnHeader) {
46924692
if (outFile.exists()) {
46934693
assertTrue(outFile.delete());
46944694
}
4695-
ReadToFileOptions readToFileOptions = new ReadToFileOptions();
4696-
readToFileOptions.setUserPrincipalName(upnHeader).setFilePath(outFile.getPath()).setRange(null)
4697-
.setParallelTransferOptions(null).setDownloadRetryOptions(null).setDataLakeRequestConditions(null)
4695+
ReadToFileOptions readToFileOptions = new ReadToFileOptions(outFile.getPath());
4696+
readToFileOptions.setUserPrincipalName(upnHeader).setRange(null).setParallelTransferOptions(null)
4697+
.setDownloadRetryOptions(null).setDataLakeRequestConditions(null)
46984698
.setRangeGetContentMd5(false).setOpenOptions(null);
46994699

47004700
StepVerifier.create(fc.readToFile(readToFileOptions))

sdk/storage/azure-storage-queue/src/main/java/module-info.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@
44
module com.azure.storage.queue {
55
requires transitive com.azure.storage.common;
66

7-
requires com.azure.xml;
8-
requires java.xml;
9-
107
exports com.azure.storage.queue;
118
exports com.azure.storage.queue.models;
129
exports com.azure.storage.queue.sas;

0 commit comments

Comments
 (0)