Skip to content

Commit 35a6146

Browse files
committed
Resolve merge conflict in ZipFileProvider
Combined resource leak fixes with new URL API from origin/main. Maintained try-with-resources pattern while using URL.of().
2 parents 90aa92b + aa0619f commit 35a6146

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;
@@ -44,7 +45,7 @@ protected ZipFileProvider(
4445
public List<String> getTargetList() {
4546
List<String> targetList;
4647
try (ReadableByteChannel readableByteChannel =
47-
Channels.newChannel(new URL(sourceUrl).openStream());
48+
Channels.newChannel(URL.of(URI.create(sourceUrl), null).openStream());
4849
FileOutputStream fileOutputStream = new FileOutputStream(zipFilename)) {
4950
fileOutputStream.getChannel().transferFrom(readableByteChannel, 0, Long.MAX_VALUE);
5051
} catch (IOException e) {

0 commit comments

Comments
 (0)