diff options
| author | Joshua Rahm <joshua.rahm@colorado.edu> | 2015-01-30 17:11:48 -0700 |
|---|---|---|
| committer | Joshua Rahm <joshua.rahm@colorado.edu> | 2015-01-30 17:11:48 -0700 |
| commit | 1c5e38fe69ac8a6decbdd8abe93112f4e3369315 (patch) | |
| tree | 926cef8cb76d46862ed2c4ec7028720611e47476 /src/utilities/PublicFileClassLoader.java | |
| download | Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.gz Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.tar.bz2 Modulus3D-1c5e38fe69ac8a6decbdd8abe93112f4e3369315.zip | |
added source
Diffstat (limited to 'src/utilities/PublicFileClassLoader.java')
| -rw-r--r-- | src/utilities/PublicFileClassLoader.java | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/src/utilities/PublicFileClassLoader.java b/src/utilities/PublicFileClassLoader.java new file mode 100644 index 0000000..addf4f9 --- /dev/null +++ b/src/utilities/PublicFileClassLoader.java @@ -0,0 +1,44 @@ +/* */ package utilities; +/* */ +/* */ import java.io.File; +/* */ import java.net.MalformedURLException; +/* */ import java.net.URI; +/* */ import java.net.URL; +/* */ import java.net.URLClassLoader; +/* */ +/* */ public class PublicFileClassLoader extends URLClassLoader +/* */ { +/* */ public PublicFileClassLoader() +/* */ { +/* 15 */ super(new URL[0]); +/* */ } +/* */ public PublicFileClassLoader(String dir) throws MalformedURLException { +/* 18 */ this(new File(dir)); +/* */ } +/* */ public PublicFileClassLoader(File directory) throws MalformedURLException { +/* 21 */ super(new URL[] { directory.toURI().toURL() }); +/* */ } +/* */ public PublicFileClassLoader(File[] dirs) throws MalformedURLException { +/* 24 */ this(); +/* 25 */ for (File f : dirs) addURL(f.toURI().toURL()); +/* */ } +/* */ +/* 28 */ public void addURL(URL url) { super.addURL(url); } +/* */ +/* */ public boolean addDir(String dir) { +/* 31 */ return addDir(new File(dir)); +/* */ } +/* */ public boolean addDir(File dir) { +/* */ try { +/* 35 */ addURL(dir.toURI().toURL()); +/* 36 */ return true; +/* */ } catch (MalformedURLException e) { +/* */ } +/* 39 */ return false; +/* */ } +/* */ } + +/* Location: Modulus.jar + * Qualified Name: utilities.PublicFileClassLoader + * JD-Core Version: 0.6.2 + */
\ No newline at end of file |