de.fub.bytecode
Class ClassPath

java.lang.Object
  |
  +--de.fub.bytecode.ClassPath

public class ClassPath
extends java.lang.Object

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

Version:
$Id: ClassPath.java,v 1.4 2001/08/24 08:35:33 dahm 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)
           
 java.io.InputStream getInputStream(java.lang.String name)
           
 java.io.InputStream getInputStream(java.lang.String name, java.lang.String suffix)
           
 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

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
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