Skip to content

Commit fd26659

Browse files
committed
Fix deprecated URL constructor usage in ZipFileProvider
Replace deprecated URL(String) constructor with URL.of(URI.create(String), null) to resolve Java 20+ deprecation warning.
1 parent 47872ac commit fd26659

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/de/rub/nds/crawler/targetlist/ZipFileProvider.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
package de.rub.nds.crawler.targetlist;
1010

1111
import java.io.*;
12+
import java.net.URI;
1213
import java.net.URL;
1314
import java.nio.channels.Channels;
1415
import java.nio.channels.ReadableByteChannel;
@@ -45,7 +46,7 @@ public List<String> getTargetList() {
4546
List<String> targetList;
4647
try {
4748
ReadableByteChannel readableByteChannel =
48-
Channels.newChannel(new URL(sourceUrl).openStream());
49+
Channels.newChannel(URL.of(URI.create(sourceUrl), null).openStream());
4950
FileOutputStream fileOutputStream = new FileOutputStream(zipFilename);
5051
fileOutputStream.getChannel().transferFrom(readableByteChannel, 0, Long.MAX_VALUE);
5152
fileOutputStream.close();

0 commit comments

Comments
 (0)