org.apache.bcel.util

Class ClassPath

public class ClassPath extends Object implements Serializable

Responsible for loading (class) files from the CLASSPATH. Inspired by sun.tools.ClassPath.
Nested Class Summary
interfaceClassPath.ClassFile
Contains information about file/ZIP entry of the Java class.
Field Summary
static ClassPathSYSTEM_CLASS_PATH
Constructor Summary
ClassPath(String class_path)
Search for classes in given path.
ClassPath()
Search for classes in CLASSPATH.
Method Summary
booleanequals(Object o)
byte[]getBytes(String name, String suffix)
byte[]getBytes(String name)
ClassPath.ClassFilegetClassFile(String name, String suffix)
ClassPath.ClassFilegetClassFile(String name)
static StringgetClassPath()
Checks for class path components in the following properties: "java.class.path", "sun.boot.class.path", "java.ext.dirs"
InputStreamgetInputStream(String name)
InputStreamgetInputStream(String name, String suffix)
Return stream for class or resource on CLASSPATH.
StringgetPath(String name)
StringgetPath(String name, String suffix)
inthashCode()
StringtoString()

Field Detail

SYSTEM_CLASS_PATH

public static final ClassPath SYSTEM_CLASS_PATH

Constructor Detail

ClassPath

public ClassPath(String class_path)
Search for classes in given path.

ClassPath

public ClassPath()

Deprecated: Use SYSTEM_CLASS_PATH constant

Search for classes in CLASSPATH.

Method Detail

equals

public boolean equals(Object o)

getBytes

public byte[] getBytes(String name, String suffix)

Parameters: name fully qualified file name, e.g. java/lang/String suffix file name ends with suffix, e.g. .java

Returns: byte array for file on class path

getBytes

public byte[] getBytes(String name)

Returns: byte array for class

getClassFile

public ClassPath.ClassFile getClassFile(String name, String suffix)

Parameters: name fully qualified file name, e.g. java/lang/String suffix file name ends with suff, e.g. .java

Returns: class file for the java class

getClassFile

public ClassPath.ClassFile getClassFile(String name)

Parameters: name fully qualified class name, e.g. java.lang.String

Returns: input stream for class

getClassPath

public static final String getClassPath()
Checks for class path components in the following properties: "java.class.path", "sun.boot.class.path", "java.ext.dirs"

Returns: class path as used by default by BCEL

getInputStream

public InputStream getInputStream(String name)

Parameters: name fully qualified class name, e.g. java.lang.String

Returns: input stream for class

getInputStream

public InputStream getInputStream(String name, String suffix)
Return stream for class or resource on CLASSPATH.

Parameters: name fully qualified file name, e.g. java/lang/String suffix file name ends with suff, e.g. .java

Returns: input stream for file on class path

getPath

public String getPath(String name)

Parameters: name name of file to search for, e.g. java/lang/String.java

Returns: full (canonical) path for file

getPath

public String getPath(String name, String suffix)

Parameters: name name of file to search for, e.g. java/lang/String suffix file name suffix, e.g. .java

Returns: full (canonical) path for file, if it exists

hashCode

public int hashCode()

toString

public String toString()

Returns: used class path string