@@ -58,7 +58,8 @@ public ClasspathScanner(Consumer<Class<?>> listener) {
58
58
* This parameter is optional, but it is highly recommended to specify it, as it can speed up the process
59
59
* dramatically.
60
60
* <p>
61
- * Inspired by https://github.com/ddopson/java-class-enumerator
61
+ * Inspired by <a
62
+ * href="https://github.com/ddopson/java-class-enumerator">https://github.com/ddopson/java-class-enumerator</a>
62
63
*
63
64
* @param scanPath Package narrowing down the scan space. Optional
64
65
*/
@@ -81,7 +82,9 @@ public void processClasses(String scanPath) {
81
82
Enumeration <URL > resources = loader .getResources ("." );
82
83
while (resources .hasMoreElements ()) {
83
84
URL resourceURL = resources .nextElement ();
84
- if (isJar (resourceURL .toString ())) {processJarFile (resourceURL , scanPath );}
85
+ if (isJar (resourceURL .toString ())) {
86
+ processJarFile (resourceURL , scanPath );
87
+ }
85
88
}
86
89
} catch (IOException e ) {
87
90
throw new JsonLdException ("Unable to scan packages." , e );
@@ -103,8 +106,9 @@ private static URI getUrlAsUri(URL url) {
103
106
104
107
protected void processJarFile (URL jarResource , String packageName ) {
105
108
final String relPath = packageName .replace ('.' , '/' );
106
- final String jarPath = jarResource .getPath ().replaceFirst ("[.]jar[!].*" , JAR_FILE_SUFFIX )
107
- .replaceFirst ("file:" , "" );
109
+ final String jarPath = jarResource .getPath ().replaceFirst ("[.]jar/?!.*" , JAR_FILE_SUFFIX )
110
+ .replaceFirst ("file:" , "" )
111
+ .replaceFirst ("nested:" , "" );
108
112
109
113
LOG .trace ("Scanning jar file {} for classes." , jarPath );
110
114
try (final JarFile jarFile = new JarFile (jarPath )) {
0 commit comments