Top Description Inners Fields Constructors Methods
org.apache.bcel.util

public Class ClassPath

extends Object
implements Closeable
Class Inheritance
All Implemented Interfaces
java.io.Closeable, java.lang.AutoCloseable
Imports
java.io.Closeable, .DataInputStream, .File, .FileInputStream, .FilenameFilter, .IOException, .InputStream, java.net.MalformedURLException, .URL, java.nio.file.Files, .Path, .Paths, java.util.ArrayList, .Arrays, .Enumeration, .List, .Locale, .Objects, .StringTokenizer, .Vector, java.util.stream.Collectors, java.util.zip.ZipEntry, .ZipFile, org.apache.bcel.classfile.JavaClass, .Utility

Loads class files from the CLASSPATH. Inspired by sun.tools.ClassPath.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private abstract static class
private abstract static class
public static interface
ClassPath.ClassFile

Contains information about file/ZIP entry of the Java class.

private static class
private static class
private static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final FilenameFilter
private final String
private static final FilenameFilter
private final ClassPath
private final List<ClassPath.AbstractPathEntry>
public static final ClassPath

Constructor Summary

AccessConstructor and Description
public
ClassPath()

Deprecated Use SYSTEM_CLASS_PATH constant
Search for classes in CLASSPATH.
public
ClassPath(final ClassPath parent, final String classPathString)

public
ClassPath(final String classPath)

Search for classes in given path.

Method Summary

Modifier and TypeMethod and Description
private static void
addJdkModules(final String javaHome, final List<String> list)

public void
close()

Implements java.io.Closeable.close.

Closes this stream and releases any system resources associated with it.
public boolean
equals(final Object
the reference object with which to compare.
obj
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public byte[]

Returns:

byte array for class
getBytes
(final String
fully qualified file name, e.g. java/lang/String
name
)

public byte[]

Returns:

byte array for file on class path
getBytes
(final String
fully qualified file name, e.g. java/lang/String
name
,
final String
file name ends with suffix, e.g. .java
suffix
)

public ClassPath.ClassFile

Returns:

input stream for class
getClassFile
(final String
fully qualified class name, e.g. java.lang.String
name
)

public ClassPath.ClassFile

Returns:

class file for the Java class
getClassFile
(final String
fully qualified file name, e.g. java/lang/String
name
,
final String
file name ends with suff, e.g. .java
suffix
)

private ClassPath.ClassFile
getClassFileInternal(final String name, final String suffix)

public static String

Returns:

class path as used by default by BCEL
getClassPath
()

Checks for class path components in the following properties: "java.class.path", "sun.boot.class.path", "java.ext.dirs"

public InputStream

Returns:

input stream for class
getInputStream
(final String
fully qualified class name, e.g. java.lang.String
name
)

Gets an InputStream.

public InputStream

Returns:

input stream for file on class path
getInputStream
(final String
fully qualified file name, e.g. java/lang/String
name
,
final String
file name ends with suff, e.g. .java
suffix
)

Gets an InputStream for a class or resource on the classpath.

public String

Returns:

full (canonical) path for file
getPath
(String
name of file to search for, e.g. java/lang/String.java
name
)

public String

Returns:

full (canonical) path for file, if it exists
getPath
(final String
name of file to search for, e.g. java/lang/String
name
,
final String
file name suffix, e.g. .java
suffix
)

private static void
getPathComponents(final String path, final List<String> list)

public URL

Returns:

URL supplying the resource, or null if no resource with that name.
getResource
(final String
fully qualified resource name, e.g. java/lang/String.class
name
)

public InputStream

Returns:

InputStream supplying the resource, or null if no resource with that name.
getResourceAsStream
(final String
fully qualified resource name, e.g. java/lang/String.class
name
)

public Enumeration<URL>

Returns:

An Enumeration of URLs supplying the resource, or an empty Enumeration if no resource with that name.
getResources
(final String
fully qualified resource name, e.g. java/lang/String.class
name
)

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public String

Returns:

used class path string
toString
()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait