Skip to content

Commit

Permalink
Merge pull request #154 from galet/fix-ClassPathScanner-for-weblogic
Browse files Browse the repository at this point in the history
Modify the ClassPathScanner to support URIs prefixed with "zip:"
  • Loading branch information
edudant authored Nov 4, 2016
2 parents c80a505 + f4e5ca9 commit 4ccdb24
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class ClassPathScanner implements Scanner {
// scan for files inside JAR file - e.g. jar:file:\J:\HotswapAgent\target\HotswapAgent-1.0.jar!\org\hotswap\agent\plugin
public static final String JAR_URL_SEPARATOR = "!/";
public static final String JAR_URL_PREFIX = "jar:";
public static final String ZIP_URL_PREFIX = "zip:";
public static final String FILE_URL_PREFIX = "file:";


Expand All @@ -47,8 +48,8 @@ public void scan(ClassLoader classLoader, String path, ScannerVisitor visitor) t
throw new IOException("Illegal directory URI " + pluginDirURL, e);
}

if (uri.startsWith(JAR_URL_PREFIX)) {
String jarFile = uri.substring(JAR_URL_PREFIX.length());
if (uri.startsWith(JAR_URL_PREFIX) || uri.startsWith(ZIP_URL_PREFIX)) {
String jarFile = uri.substring(uri.indexOf(':') + 1); // remove the prefix
scanJar(jarFile, visitor);
} else {
LOGGER.warning("Unknown resource type of file " + uri);
Expand Down

0 comments on commit 4ccdb24

Please sign in to comment.