jodd-core/src/main/java/jodd/util/ClassLoaderUtil.java
public static File[] getDefaultClasspath(ClassLoader classLoader) {
		Set<File> classpaths = new TreeSet<>();

		while (classLoader != null) {
			URL[] urls = ClassPathURLs.of(classLoader, null);
			if (urls != null) {
				for (URL u : urls) {
					File f = FileUtil.toContainerFile(u);
					if ((f != null) && f.exists()) {
						try {
							f = f.getCanonicalFile();

							boolean newElement = classpaths.add(f);
							if (newElement) {
								addInnerClasspathItems(classpaths, f);
							}
						} catch (IOException ignore) {
						}
					}
				}
			}
			classLoader = classLoader.getParent();
		}

		File[] result = new File[classpaths.size()];
		return classpaths.toArray(result);
	}
public static File[] getDefaultClasspath(ClassLoader classLoader) {
		Set<File> classpaths = new TreeSet<>();

		while (classLoader != null) {
			URL[] urls = ClassPathURLs.of(classLoader, null);
			if (urls != null) {
				for (URL u : urls) {
					File f = FileUtil.toContainerFile(u);
					if ((f != null) && f.exists()) {
						try {
							f = f.getCanonicalFile();

							boolean newElement = classpaths.add(f);
							if (newElement) {
								addInnerClasspathItems(classpaths, f);
							}
						} catch (IOException ignore) {
						}
					}
				}
			}
			classLoader = classLoader.getParent();
		}

		File[] result = new File[classpaths.size()];
		return classpaths.toArray(result);
	}
public static File [ ] getDefaultClasspath ( ClassLoader classLoader ) { Set < File > classpaths = new TreeSet <> ( ) ; while ( classLoader != null ) { URL [ ] urls = ClassPathURLs . of ( classLoader , null ) ; if ( urls != null ) { for ( URL u : urls ) { File f = FileUtil . toContainerFile ( u ) ; if ( ( f != null ) && f . exists ( ) ) { try { f = f . getCanonicalFile ( ) ; boolean newElement = classpaths . add ( f ) ; if ( newElement ) { addInnerClasspathItems ( classpaths , f ) ; } } catch ( IOException ignore ) { } } } } classLoader = classLoader . getParent ( ) ; } File [ ] result = new File [ classpaths . size ( ) ] ; return classpaths . toArray ( result ) ; }
Returns default class path from all available <code>URLClassLoader</code>
in classloader hierarchy. The following is added to the classpath list:
<ul>
<li>file URLs from <code>URLClassLoader</code> (other URL protocols are ignored)</li>
<li>inner entries from containing <b>manifest</b> files (if exist)</li>
<li>bootstrap classpath is ignored</li>
</ul>
Returns default class path from all available <code > URLClassLoader< / code > in classloader hierarchy . The following is added to the classpath list : <ul > <li > file URLs from <code > URLClassLoader< / code > ( other URL protocols are ignored ) < / li > <li > inner entries from containing <b > manifest< / b > files ( if exist ) < / li > <li > bootstrap classpath is ignored< / li > < / ul >