Skip to content

Commit

Permalink
Merge branch '2.1.x' into 2.2.x
Browse files Browse the repository at this point in the history
Closes gh-21320
  • Loading branch information
philwebb committed May 5, 2020
2 parents 487329f + df70c42 commit 98d27db
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Expand Up @@ -25,6 +25,7 @@
import java.net.URL;
import java.net.URLClassLoader;
import java.net.URLConnection;
import java.nio.file.InvalidPathException;
import java.util.ArrayList;
import java.util.List;
import java.util.jar.JarFile;
Expand Down Expand Up @@ -124,7 +125,7 @@ private boolean isResourcesJar(File file) {
try {
return isResourcesJar(new JarFile(file));
}
catch (IOException ex) {
catch (IOException | InvalidPathException ex) {
return false;
}
}
Expand Down
Expand Up @@ -77,6 +77,15 @@ void uncPathsAreTolerated() throws Exception {
assertThat(staticResourceJarUrls).hasSize(1);
}

@Test
void ignoreWildcardUrls() throws Exception {
File jarFile = createResourcesJar("test-resources.jar");
URL folderUrl = jarFile.getParentFile().toURI().toURL();
URL wildcardUrl = new URL(folderUrl.toString() + "*.jar");
List<URL> staticResourceJarUrls = new StaticResourceJars().getUrlsFrom(wildcardUrl);
assertThat(staticResourceJarUrls).isEmpty();
}

private File createResourcesJar(String name) throws IOException {
return createJar(name, (output) -> {
JarEntry jarEntry = new JarEntry("META-INF/resources");
Expand Down

0 comments on commit 98d27db

Please sign in to comment.