Class ClassPath

java.lang.Object
org.aspectj.apache.bcel.util.ClassPath
All Implemented Interfaces:
Serializable

public class ClassPath extends Object implements Serializable
Responsible for loading (class) files from the CLASSPATH. Inspired by sun.tools.ClassPath.
Author:
M. Dahm, Mario Ivankovits, Andy Clement
See Also:
Serialized Form
  • Constructor Details

    • ClassPath

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

      @Deprecated public ClassPath()
      Deprecated.
      Use SYSTEM_CLASS_PATH constant
      Search for classes in CLASSPATH.
  • Method Details

    • getSystemClassPath

      public static ClassPath getSystemClassPath()
    • toString

      public String toString()
      Overrides:
      toString in class Object
      Returns:
      used class path string
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • 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) throws IOException
      Parameters:
      name - fully qualified class name, e.g. java.lang.String
      Returns:
      input stream for class
      Throws:
      IOException
    • getInputStream

      public InputStream getInputStream(String name, String suffix) throws 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
      Throws:
      IOException
    • getClassFile

      public ClassPath.ClassFile getClassFile(String name, String suffix) throws 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
      Throws:
      IOException
    • getClassFile

      public ClassPath.ClassFile getClassFile(String name) throws IOException
      Parameters:
      name - fully qualified class name, e.g. java.lang.String
      Returns:
      input stream for class
      Throws:
      IOException
    • getBytes

      public byte[] getBytes(String name, String suffix) throws 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
      Throws:
      IOException
    • getBytes

      public byte[] getBytes(String name) throws IOException
      Returns:
      byte array for class
      Throws:
      IOException
    • getPath

      public String getPath(String name) throws IOException
      Parameters:
      name - name of file to search for, e.g. java/lang/String.java
      Returns:
      full (canonical) path for file
      Throws:
      IOException
    • getPath

      public String getPath(String name, String suffix) throws 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
      Throws:
      IOException