https://github.com/marschall/path-classloader
A Class Loader that works on a Java 7 (JSR-203) file system path.
https://github.com/marschall/path-classloader
Last synced: about 1 month ago
JSON representation
A Class Loader that works on a Java 7 (JSR-203) file system path.
- Host: GitHub
- URL: https://github.com/marschall/path-classloader
- Owner: marschall
- Created: 2012-12-26T17:49:28.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2022-01-24T18:40:53.000Z (over 3 years ago)
- Last Synced: 2025-03-27T02:43:13.823Z (about 2 months ago)
- Language: Java
- Size: 31.3 KB
- Stars: 11
- Watchers: 2
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Path Class Loader [](https://app.travis-ci.com/marschall/path-classloader)
=================A class loader that can be created on a Java 7 (JSR-203) file system path. This is very similar to `URLClassLoader` except that it works on any file system. `URLClassLoader` only works when a corresponding `URLStreamHandler` is installed which [is hard to do in a non-intrusive way](http://www.unicon.net/node/776).
This class loader does not work with Spring resource scanning because the way Spring resource scanning is implemented it works only for folders and JAR files.
Usage
-----
```java
ClassLoader classLoader = new PathClassLoader(aPath);
```The constructor argument `aPath` is expected to be a folder. If you have the classes in a JAR create a [Zip File System](http://docs.oracle.com/javase/7/docs/technotes/guides/io/fsp/zipfilesystemprovider.html). If you run into [Bug 8004789](http://bugs.sun.com/view_bug.do?bug_id=8004789) use the [backport for JDK7](https://github.com/marschall/zipfilesystem-standalone).
You can optionally pass in a parent `ClassLoader` in this case parent-first classloading will be used (Java SE default).
Maven
-----```xml
com.github.marschall
path-classloader
1.0.0```