getRdResources

fun ClassLoader.getRdResources(name: String): Sequence<URL>


fun URLClassLoader.getRdResources(name: String): Sequence<URL>

This function is different from the default behavior of ClassLoader.getResources. The default implementation will scan .jar files for the entries exactly identical to the passed name, and if there are no such entries, it won't return anything at all.

We've found that some .jar files have no directory entries, but have entries for files in these directories. For example, a "normal" .jar file may include the following structure:

  • com

  • com/Foo.class

While an "abnormal" .jar file may only include com/Foo.class, without an entry for com.

For the abnormal .jar files, this function will try to "fix" the virtual .jar structure by fabricating URLs pointing to non-existing entries (that still logically contain nested resources).