Class ClassPath
java.lang.Object
org.apache.bcel.util.ClassPath
- All Implemented Interfaces:
Closeable, AutoCloseable
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceContains information about file/ZIP entry of the Java class. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()booleanbyte[]Gets byte array for the given class.byte[]Gets byte array for the given file.getClassFile(String name) Gets the input stream for the given class.getClassFile(String name, String suffix) Gets the class file for the given Java class.static StringChecks for class path components in the following properties: "java.class.path", "sun.boot.class.path", "java.ext.dirs"getInputStream(String name) Gets an InputStream.getInputStream(String name, String suffix) Gets an InputStream for a class or resource on the classpath.Gets the full canonical path for the given file.Gets the full canonical path for the given file.getResource(String name) Gets the URL for the given resource.getResourceAsStream(String name) Gets the InputStream for the given resource.getResources(String name) Gets an Enumeration of URLs for the given resource.inthashCode()toString()
-
Field Details
-
SYSTEM_CLASS_PATH
The system class path.
-
-
Constructor Details
-
ClassPath
Deprecated.Use SYSTEM_CLASS_PATH constantSearch for classes in CLASSPATH. -
ClassPath
-
ClassPath
-
-
Method Details
-
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.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-
equals
-
getBytes
Gets byte array for the given class.- Parameters:
name- fully qualified file name, for example java/lang/String.- Returns:
- byte array for class.
- Throws:
IOException- if an I/O error occurs.
-
getBytes
Gets byte array for the given file.- Parameters:
name- fully qualified file name, for example java/lang/String.suffix- file name ends with suffix, for example .java.- Returns:
- byte array for file on class path.
- Throws:
IOException- if an I/O error occurs.
-
getClassFile
Gets the input stream for the given class.- Parameters:
name- fully qualified class name, for exampleString.- Returns:
- input stream for class.
- Throws:
IOException- if an I/O error occurs.
-
getClassFile
Gets the class file for the given Java class.- Parameters:
name- fully qualified file name, for example java/lang/String.suffix- file name ends with suffix, for example .java.- Returns:
- class file for the Java class.
- Throws:
IOException- if an I/O error occurs.
-
getInputStream
Gets an InputStream.The caller is responsible for closing the InputStream.
- Parameters:
name- fully qualified class name, for exampleString.- Returns:
- input stream for class.
- Throws:
IOException- if an I/O error occurs.
-
getInputStream
Gets an InputStream for a class or resource on the classpath.The caller is responsible for closing the InputStream.
- Parameters:
name- fully qualified file name, for example java/lang/String.suffix- file name ends with suff, for example .java.- Returns:
- input stream for file on class path.
- Throws:
IOException- if an I/O error occurs.
-
getPath
Gets the full canonical path for the given file.- Parameters:
name- name of file to search for, for example java/lang/String.java.- Returns:
- full (canonical) path for file.
- Throws:
IOException- if an I/O error occurs.
-
getPath
Gets the full canonical path for the given file.- Parameters:
name- name of file to search for, for example java/lang/String.suffix- file name suffix, for example .java.- Returns:
- full (canonical) path for file, if it exists.
- Throws:
IOException- if an I/O error occurs.
-
getResource
Gets the URL for the given resource.- Parameters:
name- fully qualified resource name, for example java/lang/String.class.- Returns:
- URL supplying the resource, or null if no resource with that name.
- Since:
- 6.0
-
getResourceAsStream
Gets the InputStream for the given resource.- Parameters:
name- fully qualified resource name, for example java/lang/String.class.- Returns:
- InputStream supplying the resource, or null if no resource with that name.
- Since:
- 6.0
-
getResources
Gets an Enumeration of URLs for the given resource.- Parameters:
name- fully qualified resource name, for example java/lang/String.class.- Returns:
- An Enumeration of URLs supplying the resource, or an empty Enumeration if no resource with that name.
- Since:
- 6.0
-
hashCode
-
toString
-