String urlName = name.replace('.", '/");
byte buf[];
Class cl;
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
int i = name.lastIndexOf('.");
if (i >= 0)
sm.checkPackageDefinition(name.substring(0, i));
}
try {
URL url = new URL(urlBase, urlName + ".class");
if (printLoadMessages)
System.out.println("Loading " + url);
InputStream is = url.openConnection().getInputStream();
buf = getClassBytes(is);
// Starting in 1.2 beta 4, we no longer use a code source in
// this example
// CodeSource cs = getCodeSource(urlBase, null);
// cl = defineClass(name, buf, 0, buf.length, cs, null);
cl = defineClass(name, buf, 0, buf.length);
return cl;
} catch (Exception e) {
System.out.println("Can't load " + name + ": " + e);
return null;
}