Skip to content

A Class Loader that works on a Java 7 (JSR-203) file system path.

Notifications You must be signed in to change notification settings

marschall/path-classloader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Path Class Loader Build Status

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.

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

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. If you run into Bug 8004789 use the backport for JDK7.

You can optionally pass in a parent ClassLoader in this case parent-first classloading will be used (Java SE default).

Maven

<dependency>
  <groupId>com.github.marschall</groupId>
  <artifactId>path-classloader</artifactId>
  <version>1.0.0</version>
</dependency>

About

A Class Loader that works on a Java 7 (JSR-203) file system path.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages