8000 update · jaikumarAJ/Java-Coding-Problems@97adca5 · GitHub
[go: up one dir, main page]

Skip to content

Commit 97adca5

Browse files
committed
update
1 parent 148a570 commit 97adca5

File tree

1 file changed

+2
-1
lines changed
  • Chapter_14/P298_DownloadOfFileDownload/src/modern/challenge

1 file changed

+2
-1
lines changed

Chapter_14/P298_DownloadOfFileDownload/src/modern/challenge/Main.java

Lines changed: 2 additions & 1 deletion
import static java.nio.file.StandardOpenOption.CREATE;
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.net.http.HttpResponse;
88
import java.nio.file.Path;
99
10+
import static java.nio.file.StandardOpenOption.WRITE;
1011

1112
public class Main {
1213

@@ -22,7 +23,7 @@ public static void main(String[] args) throws IOException, InterruptedException
2223

2324
HttpResponse<Path> response = client.send(
2425
request, HttpResponse.BodyHandlers
25-
.ofFileDownload(Path.of(System.getProperty("user.dir")), CREATE));
26+
.ofFileDownload(Path.of(System.getProperty("user.dir")), CREATE, WRITE));
2627

2728
System.out.println("Status code: " + response.statusCode());
2829
System.out.println("\n Body: " + response.body());

0 commit comments

Comments
 (0)
0