diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileAsyncClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileAsyncClient.java index 4f17dbeb347f0..4658334268999 100644 --- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileAsyncClient.java +++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileAsyncClient.java @@ -1477,7 +1477,7 @@ public Mono readToFile(String filePath) { * * *
-     * client.readToFile(new ReadToFileOptions().setFilePath(file))
+     * client.readToFile(new ReadToFileOptions(file))
      *     .subscribe(response -> System.out.println("Completed download to file"));
      * 
* @@ -1590,8 +1590,7 @@ public Mono> readToFileWithResponse(String filePath, Fi * * *
-     * ReadToFileOptions options = new ReadToFileOptions();
-     * options.setFilePath(file);
+     * ReadToFileOptions options = new ReadToFileOptions(file);
      * options.setRange(new FileRange(1024, 2048L));
      * options.setDownloadRetryOptions(new DownloadRetryOptions().setMaxRetryRequests(5));
      * options.setOpenOptions(new HashSet<>(Arrays.asList(StandardOpenOption.CREATE_NEW,
diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileClient.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileClient.java
index 13db4f0742af3..88c6c0fec2039 100644
--- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileClient.java
+++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/DataLakeFileClient.java
@@ -1226,7 +1226,7 @@ public PathProperties readToFile(String filePath) {
      *
      * 
      * 
-     * client.readToFile(new ReadToFileOptions().setFilePath(file));
+     * client.readToFile(new ReadToFileOptions(file));
      * System.out.println("Completed download to file");
      * 
* @@ -1348,8 +1348,7 @@ public Response readToFileWithResponse(String filePath, FileRang * * *
-     * ReadToFileOptions options = new ReadToFileOptions();
-     * options.setFilePath(file);
+     * ReadToFileOptions options = new ReadToFileOptions(file);
      * options.setRange(new FileRange(1024, 2048L));
      * options.setDownloadRetryOptions(new DownloadRetryOptions().setMaxRetryRequests(5));
      * options.setOpenOptions(new HashSet<>(Arrays.asList(StandardOpenOption.CREATE_NEW,
diff --git a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/ReadToFileOptions.java b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/ReadToFileOptions.java
index 04814b47f75a4..8887975bf4140 100644
--- a/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/ReadToFileOptions.java
+++ b/sdk/storage/azure-storage-file-datalake/src/main/java/com/azure/storage/file/datalake/options/ReadToFileOptions.java
@@ -4,6 +4,7 @@
 package com.azure.storage.file.datalake.options;
 
 import com.azure.storage.common.ParallelTransferOptions;
+import com.azure.storage.common.implementation.StorageImplUtils;
 import com.azure.storage.file.datalake.DataLakeFileClient;
 import com.azure.storage.file.datalake.models.DataLakeRequestConditions;
 import com.azure.storage.file.datalake.models.DownloadRetryOptions;
@@ -18,29 +19,30 @@
  * Parameters when calling readToFile() on {@link DataLakeFileClient}
  */
 public class ReadToFileOptions {
-    private String filePath;
+    private final String filePath;
     private FileRange range;
     private ParallelTransferOptions parallelTransferOptions;
     private DownloadRetryOptions downloadRetryOptions;
     private DataLakeRequestConditions dataLakeRequestConditions;
-    private boolean rangeGetContentMd5;
+    private Boolean rangeGetContentMd5;
     private Set openOptions;
     private Boolean userPrincipalName;
 
     /**
-     * @return A {@link String} representing the filePath where the downloaded data will be written.
+     * Constructs a {@link ReadToFileOptions}.
+     *
+     * @param filePath Path of the file to download to.
      */
-    public String getFilePath() {
-        return filePath;
+    public ReadToFileOptions(String filePath) {
+        StorageImplUtils.assertNotNull("filePath", filePath);
+        this.filePath = filePath;
     }
 
     /**
-     * @param filePath A {@link String} representing the filePath where the downloaded data will be written.
-     * @return The updated options.
+     * @return A {@link String} representing the filePath where the downloaded data will be written.
      */
-    public ReadToFileOptions setFilePath(String filePath) {
-        this.filePath = filePath;
-        return this;
+    public String getFilePath() {
+        return filePath;
     }
 
     /**
@@ -113,7 +115,7 @@ public ReadToFileOptions setDataLakeRequestConditions(DataLakeRequestConditions
     /**
      * @return Whether the contentMD5 for the specified file range should be returned.
      */
-    public boolean isRangeGetContentMd5() {
+    public Boolean isRangeGetContentMd5() {
         return rangeGetContentMd5;
     }
 
@@ -121,7 +123,7 @@ public boolean isRangeGetContentMd5() {
      * @param rangeGetContentMd5 Whether the contentMD5 for the specified file range should be returned.
      * @return The updated options.
      */
-    public ReadToFileOptions setRangeGetContentMd5(boolean rangeGetContentMd5) {
+    public ReadToFileOptions setRangeGetContentMd5(Boolean rangeGetContentMd5) {
         this.rangeGetContentMd5 = rangeGetContentMd5;
         return this;
     }
diff --git a/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/DataLakeFileAsyncClientJavaDocSamples.java b/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/DataLakeFileAsyncClientJavaDocSamples.java
index af2498b856e65..cab57061496b7 100644
--- a/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/DataLakeFileAsyncClientJavaDocSamples.java
+++ b/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/DataLakeFileAsyncClientJavaDocSamples.java
@@ -143,7 +143,7 @@ public void downloadToFileCodeSnippet() {
         // END: com.azure.storage.file.datalake.DataLakeFileAsyncClient.readToFile#String
 
         // BEGIN: com.azure.storage.file.datalake.DataLakeFileAsyncClient.readToFile#ReadToFileOptions
-        client.readToFile(new ReadToFileOptions().setFilePath(file))
+        client.readToFile(new ReadToFileOptions(file))
             .subscribe(response -> System.out.println("Completed download to file"));
         // END: com.azure.storage.file.datalake.DataLakeFileAsyncClient.readToFile#ReadToFileOptions
 
@@ -163,8 +163,7 @@ public void downloadToFileCodeSnippet() {
         // END: com.azure.storage.file.datalake.DataLakeFileAsyncClient.readToFileWithResponse#String-FileRange-ParallelTransferOptions-DownloadRetryOptions-DataLakeRequestConditions-boolean-Set
 
         // BEGIN: com.azure.storage.file.datalake.DataLakeFileAsyncClient.readToFileWithResponse#ReadToFileOptions
-        ReadToFileOptions options = new ReadToFileOptions();
-        options.setFilePath(file);
+        ReadToFileOptions options = new ReadToFileOptions(file);
         options.setRange(new FileRange(1024, 2048L));
         options.setDownloadRetryOptions(new DownloadRetryOptions().setMaxRetryRequests(5));
         options.setOpenOptions(new HashSet<>(Arrays.asList(StandardOpenOption.CREATE_NEW,
diff --git a/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/DataLakeFileClientJavaDocSamples.java b/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/DataLakeFileClientJavaDocSamples.java
index c79ec17584f71..6673a27f80007 100644
--- a/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/DataLakeFileClientJavaDocSamples.java
+++ b/sdk/storage/azure-storage-file-datalake/src/samples/java/com/azure/storage/file/datalake/DataLakeFileClientJavaDocSamples.java
@@ -143,7 +143,7 @@ public void downloadToFile() {
         // END: com.azure.storage.file.datalake.DataLakeFileClient.readToFile#String
 
         // BEGIN: com.azure.storage.file.datalake.DataLakeFileClient.readToFile#ReadToFileOptions
-        client.readToFile(new ReadToFileOptions().setFilePath(file));
+        client.readToFile(new ReadToFileOptions(file));
         System.out.println("Completed download to file");
         // END: com.azure.storage.file.datalake.DataLakeFileClient.readToFile#ReadToFileOptions
 
@@ -165,8 +165,7 @@ public void downloadToFile() {
         // END: com.azure.storage.file.datalake.DataLakeFileClient.readToFileWithResponse#String-FileRange-ParallelTransferOptions-DownloadRetryOptions-DataLakeRequestConditions-boolean-Set-Duration-Context
 
         // BEGIN: com.azure.storage.file.datalake.DataLakeFileClient.readToFileWithResponse#ReadToFileOptions-Duration-Context
-        ReadToFileOptions options = new ReadToFileOptions();
-        options.setFilePath(file);
+        ReadToFileOptions options = new ReadToFileOptions(file);
         options.setRange(new FileRange(1024, 2048L));
         options.setDownloadRetryOptions(new DownloadRetryOptions().setMaxRetryRequests(5));
         options.setOpenOptions(new HashSet<>(Arrays.asList(StandardOpenOption.CREATE_NEW,
diff --git a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileApiTest.java b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileApiTest.java
index f4b3b982ecad2..ac9366161d895 100644
--- a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileApiTest.java
+++ b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileApiTest.java
@@ -3473,9 +3473,9 @@ public void upnHeaderTest(Boolean upnHeader) {
         if (outFile.exists()) {
             assertTrue(outFile.delete());
         }
-        ReadToFileOptions readToFileOptions = new ReadToFileOptions();
-        readToFileOptions.setUserPrincipalName(upnHeader).setFilePath(outFile.getPath()).setRange(null)
-            .setParallelTransferOptions(null).setDownloadRetryOptions(null).setDataLakeRequestConditions(null)
+        ReadToFileOptions readToFileOptions = new ReadToFileOptions(outFile.getPath());
+        readToFileOptions.setUserPrincipalName(upnHeader).setRange(null).setParallelTransferOptions(null)
+            .setDownloadRetryOptions(null).setDataLakeRequestConditions(null)
             .setRangeGetContentMd5(false).setOpenOptions(null);
 
         PathProperties readToFileResponse = fc.readToFile(readToFileOptions);
diff --git a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileAsyncApiTests.java b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileAsyncApiTests.java
index 510878bf9e400..d0a09c19b512b 100644
--- a/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileAsyncApiTests.java
+++ b/sdk/storage/azure-storage-file-datalake/src/test/java/com/azure/storage/file/datalake/FileAsyncApiTests.java
@@ -4692,9 +4692,9 @@ public void upnHeaderTest(Boolean upnHeader) {
         if (outFile.exists()) {
             assertTrue(outFile.delete());
         }
-        ReadToFileOptions readToFileOptions = new ReadToFileOptions();
-        readToFileOptions.setUserPrincipalName(upnHeader).setFilePath(outFile.getPath()).setRange(null)
-            .setParallelTransferOptions(null).setDownloadRetryOptions(null).setDataLakeRequestConditions(null)
+        ReadToFileOptions readToFileOptions = new ReadToFileOptions(outFile.getPath());
+        readToFileOptions.setUserPrincipalName(upnHeader).setRange(null).setParallelTransferOptions(null)
+            .setDownloadRetryOptions(null).setDataLakeRequestConditions(null)
             .setRangeGetContentMd5(false).setOpenOptions(null);
 
         StepVerifier.create(fc.readToFile(readToFileOptions))
diff --git a/sdk/storage/azure-storage-queue/src/main/java/module-info.java b/sdk/storage/azure-storage-queue/src/main/java/module-info.java
index 2ebe6772e091d..fea8500ddc103 100644
--- a/sdk/storage/azure-storage-queue/src/main/java/module-info.java
+++ b/sdk/storage/azure-storage-queue/src/main/java/module-info.java
@@ -4,9 +4,6 @@
 module com.azure.storage.queue {
     requires transitive com.azure.storage.common;
 
-    requires com.azure.xml;
-    requires java.xml;
-
     exports com.azure.storage.queue;
     exports com.azure.storage.queue.models;
     exports com.azure.storage.queue.sas;