public class

ClassPath

extends Object
java.lang.Object
   ↳ sun.tools.java.ClassPath

Class Overview

This class is used to represent a class path, which can contain both directories and zip files. WARNING: The contents of this source file are not part of any supported API. Code that depends on them does so at its own risk: they are subject to change or removal without notice.

Summary

Public Constructors
ClassPath(String pathstr)
Build a class path from the specified path string
ClassPath(String[] patharray)
Build a class path from the specified array of class path element strings.
ClassPath()
Build a default class path from the path strings specified by the properties sun.boot.class.path and env.class.path, in that order.
Public Methods
void close()
Release resources.
ClassFile getDirectory(String name)
Find the specified directory in the class path
ClassFile getFile(String name)
Load the specified file from the class path
Enumeration getFiles(String pkg, String ext)
Returns list of files given a package name and extension.
String toString()
Returns original class path string
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public ClassPath (String pathstr)

Build a class path from the specified path string

public ClassPath (String[] patharray)

Build a class path from the specified array of class path element strings. This constructor, and the corresponding "init" method, were added as part of the fix for 6473331, which adds support for Class-Path manifest entries in JAR files to rmic. It is conceivable that the value of a Class-Path manifest entry will contain a path separator, which would cause incorrect behavior if the expanded path were passed to the previous constructor as a single path-separator-delimited string; use of this constructor avoids that problem.

public ClassPath ()

Build a default class path from the path strings specified by the properties sun.boot.class.path and env.class.path, in that order.

Public Methods

public void close ()

Release resources.

Throws
IOException

public ClassFile getDirectory (String name)

Find the specified directory in the class path

public ClassFile getFile (String name)

Load the specified file from the class path

public Enumeration getFiles (String pkg, String ext)

Returns list of files given a package name and extension.

public String toString ()

Returns original class path string

Returns
  • a string representation of the object.