public class DirectoryClassLoader
extends java.lang.ClassLoader
PathClassLoader
Constructor and Description |
---|
DirectoryClassLoader(java.io.File dir)
Deprecated.
Constructor that provides the name of the directory in which to search
for a given class.
|
DirectoryClassLoader(java.lang.String dirName)
Deprecated.
Constructor that provides the name of the directory in which to search
for a given class.
|
Modifier and Type | Method and Description |
---|---|
java.net.URL |
findResource(java.lang.String name)
Deprecated.
Finds the resource with the given name.
|
java.net.URL |
getResource(java.lang.String name)
Deprecated.
Finds the resource with the given name.
|
java.io.InputStream |
getResourceAsStream(java.lang.String name)
Deprecated.
Returns an input stream for reading the specified resource.
|
protected java.lang.Class |
loadClass(java.lang.String name,
boolean resolve)
Deprecated.
Attempt to load a class if it is not already loaded, and optionally
resolve any imports it might have.
|
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResources, findSystemClass, getClassLoadingLock, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, registerAsParallelCapable, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
public DirectoryClassLoader(java.io.File dir)
dir
- The File specifying the directory to search.public DirectoryClassLoader(java.lang.String dirName)
dirName
- A file pathname specifying the directory to search.protected java.lang.Class loadClass(java.lang.String name, boolean resolve) throws java.lang.ClassNotFoundException
loadClass
in class java.lang.ClassLoader
name
- The fully-qualified name of the class to load.resolve
- True if imports should be resolved, false otherwise.java.lang.ClassNotFoundException
- if the class was not found.public java.io.InputStream getResourceAsStream(java.lang.String name)
getResourceAsStream
in class java.lang.ClassLoader
name
- the resource namenull
if the resource could not be found
redundant in 1.2public java.net.URL getResource(java.lang.String name)
The name of a resource is a "/"-separated path name that identifies the resource.
This method will first search the parent class loader for the
resource, then call findResource
to find the
resource.
getResource
in class java.lang.ClassLoader
name
- resource namenull
if
the resource could not be found or the caller doesn't have
adequate privileges to get the resource.
redundant in 1.2public java.net.URL findResource(java.lang.String name)
findResource
in class java.lang.ClassLoader
name
- the resource namenull
if the resource could not be foundCopyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.