VMClassLoader.java [plain text]
package gnu.gcj.runtime;
import java.io.*;
import java.util.StringTokenizer;
import java.net.URL;
public final class VMClassLoader extends java.net.URLClassLoader
{
private VMClassLoader ()
{
super (init());
}
private static URL[] init()
{
StringTokenizer st
= new StringTokenizer (System.getProperty ("java.class.path", "."),
System.getProperty ("path.separator", ":"));
java.util.Vector p = new java.util.Vector();
while (st.hasMoreElements ())
{
String e = st.nextToken ();
try
{
if (!e.endsWith (File.separator) && new File (e).isDirectory ())
p.addElement (new URL("file", "", -1, e + File.separator));
else
p.addElement (new URL("file", "", -1, e));
}
catch (java.net.MalformedURLException x)
{
}
}
try
{
p.addElement (new URL("core", "", -1, "/"));
}
catch (java.net.MalformedURLException x)
{
}
URL[] urls = new URL[p.size()];
p.copyInto (urls);
return urls;
}
protected native Class findClass(String name)
throws java.lang.ClassNotFoundException;
public static VMClassLoader instance = new VMClassLoader ();
}