## org.apache.bcel.util
Class ClassPath

    java.lang.Object
      |
      +--org.apache.bcel.util.ClassPath

public class ClassPath
extends java.lang.Object

Responsible for loading (class) files from the CLASSPATH. Inspired by sun.tools.ClassPath.

Version:
  $Id: ClassPath.java,v 1.3 2001/12/14 18:44:29 mdahm Exp $
Author:
  M. Dahm

Inner Class Summary
`static class` `ClassPath.ClassFile` Contains information about file/ZIP entry of the Java class.

Constructor Summary
`ClassPath()` Search for classes in CLASSPATH.
`ClassPath(java.lang.String class_path)` Search for classes in given path.

Method Summary
`byte[]` `getBytes(java.lang.String name)`
`byte[]` `getBytes(java.lang.String name, java.lang.String suffix)`
`ClassPath.ClassFile` `getClassFile(java.lang.String name)`
`ClassPath.ClassFile` `getClassFile(java.lang.String name, java.lang.String suffix)`
`static java.lang.String` `getClassPath()` Checks for class path components in the following properties: "java.class.path", "sun.boot.class.path", "java.ext.dirs"
`java.io.InputStream` `getInputStream(java.lang.String name)`
`java.io.InputStream` `getInputStream(java.lang.String name, java.lang.String suffix)` Return stream for class or resource on CLASSPATH.
`java.lang.String` `getPath(java.lang.String name)`
`java.lang.String` `getPath(java.lang.String name, java.lang.String suffix)`

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

Constructor Detail

### ClassPath

    public ClassPath(java.lang.String class_path)

  Search for classes in given path.

### ClassPath

    public ClassPath()

  Search for classes in CLASSPATH.

Method Detail

### getClassPath

    public static final java.lang.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 java.io.InputStream getInputStream(java.lang.String name)
                                       throws java.io.IOException

  Parameters:
    `name` - fully qualified class name, e.g. java.lang.String
  Returns:
    input stream for class

### getInputStream

    public java.io.InputStream getInputStream(java.lang.String name,
                                              java.lang.String suffix)
                                       throws java.io.IOException

  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

### getClassFile

    public ClassPath.ClassFile getClassFile(java.lang.String name,
                                            java.lang.String suffix)
                                     throws java.io.IOException

  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(java.lang.String name)
                                     throws java.io.IOException

  Parameters:
    `name` - fully qualified class name, e.g. java.lang.String
  Returns:
    input stream for class

### getBytes

    public byte[] getBytes(java.lang.String name,
                           java.lang.String suffix)
                    throws java.io.IOException

  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(java.lang.String name)
                    throws java.io.IOException

  Returns:
    byte array for class

### getPath

    public java.lang.String getPath(java.lang.String name)
                             throws java.io.IOException

  Parameters:
    `name` - name of file to search for, e.g. java/lang/String.java
  Returns:
    full (canonical) path for file

### getPath

    public java.lang.String getPath(java.lang.String name,
                                    java.lang.String suffix)
                             throws java.io.IOException

  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