Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.javatest.util
Class DirectoryClassLoader

    java.lang.Object
      java.lang.ClassLoader
          com.sun.javatest.util.DirectoryClassLoader

Deprecated. use PathClassLoader

    public class DirectoryClassLoader

extends java.lang.ClassLoader

This class loader loads classes from files a specified directory.

See Also:
  `PathClassLoader`

Constructor Summary
`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.

Method Summary
`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.

Methods inherited from class java.lang.ClassLoader
`clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResources, findSystemClass, getPackage, getPackages, getParent, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, loadClass, resolveClass, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### DirectoryClassLoader

    public DirectoryClassLoader(java.io.File dir)

  Deprecated.
  Constructor that provides the name of the directory in which to search for a given class.

  Parameters:
    `dir` - The File specifying the directory to search.

### DirectoryClassLoader

    public DirectoryClassLoader(java.lang.String dirName)

  Deprecated.
  Constructor that provides the name of the directory in which to search for a given class.

  Parameters:
    `dirName` - A file pathname specifying the directory to search.

Method Detail

### loadClass

    protected java.lang.Class loadClass(java.lang.String name,
                                        boolean resolve)
                                 throws java.lang.ClassNotFoundException

  Deprecated.
  Attempt to load a class if it is not already loaded, and optionally resolve any imports it might have.

  Overrides:
    `loadClass` in class `java.lang.ClassLoader`
  Parameters:
    `name` - The fully-qualified name of the class to load.
    `resolve` - True if imports should be resolved, false otherwise.
  Returns:
    the class that was loaded
  Throws:
    `java.lang.ClassNotFoundException` - if the class was not found.

### getResourceAsStream

    public java.io.InputStream getResourceAsStream(java.lang.String name)

  Deprecated.
  Returns an input stream for reading the specified resource.

  Overrides:
    `getResourceAsStream` in class `java.lang.ClassLoader`
  Parameters:
    `name` - the resource name
  Returns:
    an input stream for reading the resource, or `null` if the resource could not be found redundant in 1.2

### getResource

    public java.net.URL getResource(java.lang.String name)

  Deprecated.
  Finds the resource with the given name. A resource is some data (images, audio, text, etc) that can be accessed by class code in a way that is independent of the location of the code.

  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.

  Overrides:
    `getResource` in class `java.lang.ClassLoader`
  Parameters:
    `name` - resource name
  Returns:
    a URL for reading the resource, or `null` if the resource could not be found or the caller doesn't have adequate privileges to get the resource. redundant in 1.2

### findResource

    public java.net.URL findResource(java.lang.String name)

  Deprecated.
  Finds the resource with the given name. Class loader implementations should override this method to specify where to find resources.

  Overrides:
    `findResource` in class `java.lang.ClassLoader`
  Parameters:
    `name` - the resource name
  Returns:
    a URL for reading the resource, or `null` if the resource could not be found
  Since:
    JDK1.2

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved.