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

## org.apache.bcel.util
Class ClassPath

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

All Implemented Interfaces:
  java.io.Serializable

public class ClassPath
extends java.lang.Object
implements java.io.Serializable

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

Version:
  $Id: ClassPath.java,v 1.7 2002/11/10 18:30:05 mdahm Exp $
Author:
  M. Dahm
See Also:
  Serialized Form

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

Field Summary
`static ClassPath` | `SYSTEM_CLASS_PATH`

Constructor Summary
`ClassPath()` Deprecated. Use SYSTEM_CLASS_PATH constant
`ClassPath(java.lang.String class_path)` Search for classes in given path.

Method Summary
`boolean` | `equals(java.lang.Object o)`
`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)`
`int` | `hashCode()`
`java.lang.String` | `toString()`

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

Field Detail

### SYSTEM_CLASS_PATH

    public static final ClassPath SYSTEM_CLASS_PATH

Constructor Detail

### ClassPath

    public ClassPath(java.lang.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

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    used class path string

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

### equals

    public boolean equals(java.lang.Object o)

  Overrides:
    `equals` in class `java.lang.Object`

### 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
    `java.io.IOException`

### 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
    `java.io.IOException`

### 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
    `java.io.IOException`

### 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
    `java.io.IOException`

### 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
    `java.io.IOException`

### getBytes

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

  Returns:
    byte array for class
    `java.io.IOException`

### 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
    `java.io.IOException`

### 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
    `java.io.IOException`

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 © 2002-2003 Apache Software Foundation. All Rights Reserved.