| java.lang.Object net.sourceforge.groboutils.util.classes.v1.jdk0.UrlClassLoader
UrlClassLoader | public class UrlClassLoader implements IUrlClassLoader,BytecodeSource(Code) | | Class responsible for loading classes in a JDK 1.0+ version compatible
way. Need to determine speed vs. size for caching Jar files that are
loaded over the internet. For now, we cache stuff, in the hope that
the flush() will be called.
If the URL is null, or if the bytecode for a class name is not found,
then this will attempt to load the class from the system classloader.
NOTE: As of version 1.0.0, there is no longer a dependency upon
net.sourceforge.groboutils.util.io.v1
author: Matt Albrecht groboclown@users.sourceforge.net version: $Date: 2003/05/06 05:35:00 $ since: November 17, 2000 (GroboUtils Alpha 0.9.0) |
UrlClassLoader | public UrlClassLoader()(Code) | | Default constructor
|
className2jarFileName | protected String className2jarFileName(String className)(Code) | | Converts a class name to a file name.
|
convertUrl | protected String convertUrl(String url)(Code) | | Converts the given string to a fully qualified URL. If no
scheme is given, then it is converted to a File scheme.
|
findZipEntry | protected byte[] findZipEntry(String filename, ZipInputStream zis)(Code) | | Finds the entry of the given filename in the given input stream,
and returns the entry as a byte array. If the entry wasn't found,
then null is returned.
|
flush | public void flush()(Code) | | Call to flush any cache stored in the interface. This allows for
a class loader to cache results, and free up memory when it is
not needed.
|
getBytecode | public byte[] getBytecode(String classname)(Code) | | |
isJarURL | protected boolean isJarURL(String url)(Code) | | true if the URL references a Jar-like file. |
loadClass | public Class loadClass(String className, String url)(Code) | | Load the given class from the given URL. If the URL is null,
then it loads the class from the default class loader.
Parameters: className - the exact class name to load. Parameters: url - the URL from which the class is loaded. If this isnull, then this loads the class from the default classloader. the loaded Class instance, or null if the class couldnot be found. |
readByteStream | protected byte[] readByteStream(InputStream is) throws IOException(Code) | | A re-implementation of
net.groboclown.util.io.v1.ReadByteStream, to reduce
the amount of inter-package dependencies.
|
|
|