Skip to content

Commit e5a4443

Browse files
committed
Update memoyfilesystem with URL handling bugfixes
1 parent 5a574f9 commit e5a4443

File tree

3 files changed

+2
-27
lines changed

3 files changed

+2
-27
lines changed

java-compiler-testing/src/main/java/io/github/ascopes/jct/containers/impl/PackageContainerGroupUrlClassLoader.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
import io.github.ascopes.jct.workspaces.PathRoot;
2121
import java.net.URL;
2222
import java.net.URLClassLoader;
23-
import java.util.Locale;
24-
import java.util.stream.Stream;
2523
import org.apiguardian.api.API;
2624
import org.apiguardian.api.API.Status;
2725

@@ -54,25 +52,6 @@ private static URL[] extractUrls(PackageContainerGroup group) {
5452
.stream()
5553
.map(Container::getPathRoot)
5654
.map(PathRoot::getUrl)
57-
.map(PackageContainerGroupUrlClassLoader::fixMemoryFileSystemUrls)
5855
.toArray(URL[]::new);
5956
}
60-
61-
// This can be removed once https://github.com/marschall/memoryfilesystem/pull/145/files is
62-
// addressed.
63-
private static URL fixMemoryFileSystemUrls(URL url) {
64-
if (url.getPath().endsWith("/") || isProbablyArchive(url)) {
65-
return url;
66-
}
67-
68-
return uncheckedIo(() -> new URL(
69-
url.getProtocol(), url.getHost(), url.getPort(), url.getFile() + "/"
70-
));
71-
}
72-
73-
private static boolean isProbablyArchive(URL url) {
74-
return Stream
75-
.of(".jar", ".war", ".ear", ".zip")
76-
.anyMatch(url.getFile().toLowerCase(Locale.ROOT)::endsWith);
77-
}
7857
}

java-compiler-testing/src/main/java/io/github/ascopes/jct/workspaces/impl/MemoryFileSystemProvider.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -93,11 +93,7 @@ public MemoryFileSystemUrlHandlerProvider() {
9393
@Nullable
9494
@Override
9595
public URLStreamHandler createURLStreamHandler(String protocol) {
96-
// This check can be removed once https://github.com/marschall/memoryfilesystem/pull/144 is
97-
// addressed.
98-
return com.github.marschall.memoryfilesystem.MemoryFileSystemProvider.SCHEME.equals(protocol)
99-
? factory.createURLStreamHandler(protocol)
100-
: null;
96+
return factory.createURLStreamHandler(protocol);
10197
}
10298
}
10399
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
<awaitility.version>4.2.0</awaitility.version>
100100
<fuzzywuzzy.version>1.4.0</fuzzywuzzy.version>
101101
<groovy.version>4.0.12</groovy.version>
102-
<memoryfilesystem.version>2.6.0</memoryfilesystem.version>
102+
<memoryfilesystem.version>2.6.1</memoryfilesystem.version>
103103
<jspecify.version>0.3.0</jspecify.version>
104104
<junit.version>5.9.3</junit.version>
105105
<mockito.version>5.3.1</mockito.version>

0 commit comments

Comments
 (0)