Index: java/rmi/server/RMIClassLoader.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/rmi/server/RMIClassLoader.java,v
retrieving revision 1.18
diff -u -r1.18 RMIClassLoader.java
--- java/rmi/server/RMIClassLoader.java 28 Sep 2005 19:51:31 -0000 1.18
+++ java/rmi/server/RMIClassLoader.java 29 Sep 2005 13:10:37 -0000
@@ -41,6 +41,7 @@
import gnu.java.rmi.server.RMIClassLoaderImpl;
import java.net.MalformedURLException;
+import java.net.URL;
/**
* This class provides a set of public static utility methods for supporting
@@ -81,6 +82,32 @@
if (spi == null)
spi = getDefaultProviderInstance();
return spi.loadClass(codebase, name, defaultLoader);
+ }
+
+ /**
+ * Loads a class from codeBase
.
+ *
+ * This method delegates to
+ * address@hidden RMIClassLoaderSpi#loadClass(String, String, ClassLoader)} and
+ * passes codeBase.toString()
as first argument,
+ * name
as second argument and null
as third
+ * argument.
+ *
+ * @param codeBase the code base from which to load the class
+ * @param name the name of the class
+ *
+ * @return the loaded class
+ *
+ * @throws MalformedURLException if the URL is not well formed
+ * @throws ClassNotFoundException if the requested class cannot be found
+ */
+ public static Class loadClass(URL codeBase, String name)
+ throws MalformedURLException, ClassNotFoundException
+ {
+ RMIClassLoaderSpi spi = getProviderInstance();
+ if (spi == null)
+ spi = getDefaultProviderInstance();
+ return spi.loadClass(codeBase.toString(), name, null);
}
/**