|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.deltax.util.JDK12ClassFileFinder
This class emulates JDK 1.2 behaviour for finding class, providing direct access to the files / streams Of course, it work only when classes are actually loaded from a filesystem.
Field Summary | |
protected java.lang.String |
classPath
The application class path used by this classFileFinder |
Constructor Summary | |
JDK12ClassFileFinder()
Creates a classfinder which looks (besides system directories) in $java.class.path |
|
JDK12ClassFileFinder(java.lang.String classPath)
Creates a classfinder which looks (besides system directories) in the given class path |
Method Summary | |
protected java.lang.String |
classNameToEntry(java.lang.String className)
Converts a fully qualified externalized java class name into a zip file entry. |
protected java.lang.String |
classNameToPath(java.lang.String className)
Converts a fully qualified externalized java class name into a relative file path. |
java.io.File |
findClassFile(java.lang.String className)
This method emulates 1.2 behaviour for class finding - which means: - it first searches into the $java.home/lib/ and $java.home/lib/*.jar; - then in $java.ext.dirs/*.jar; - eventually in $java.class.path |
protected java.io.File[] |
findJarsInPath(java.io.File path)
Find the JAR files in the given path |
byte[] |
getBytes(java.lang.String className)
Return the byte array for the class |
protected java.util.Enumeration |
getClassPathDirs()
|
java.lang.String |
getSupportedLoadingScheme()
Returns the supported loading scheme |
boolean |
isJar(java.io.File f)
Just checks if the file ends with .jar |
static void |
main(java.lang.String[] args)
|
java.io.InputStream |
openClass(java.lang.String className)
Open class data. |
protected java.io.InputStream |
openClassInJar(java.lang.String className,
java.io.File jarFile)
Open class data in a JAR file |
protected java.io.File |
searchJars(java.lang.String className,
java.io.File[] jars)
Searches jar files for a given class path |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
protected java.lang.String classPath
Constructor Detail |
public JDK12ClassFileFinder(java.lang.String classPath)
classPath
- the search class pathpublic JDK12ClassFileFinder()
Method Detail |
public java.lang.String getSupportedLoadingScheme()
public java.io.InputStream openClass(java.lang.String className) throws java.io.IOException, java.lang.ClassNotFoundException
className
- the name of the class to findpublic java.io.File findClassFile(java.lang.String className) throws java.io.IOException, java.lang.ClassNotFoundException
className
- the name of the class to findpublic byte[] getBytes(java.lang.String className) throws java.io.IOException, java.lang.ClassNotFoundException
public boolean isJar(java.io.File f)
f
- the file to checkprotected java.io.InputStream openClassInJar(java.lang.String className, java.io.File jarFile) throws java.io.IOException, java.lang.ClassNotFoundException
protected java.io.File searchJars(java.lang.String className, java.io.File[] jars) throws java.io.IOException, java.lang.ClassNotFoundException
className
- the name of the class to findjars
- an array of JAR file objectsprotected java.io.File[] findJarsInPath(java.io.File path)
path
- the path to search inprotected java.lang.String classNameToPath(java.lang.String className)
className
- the name of the class to findprotected java.lang.String classNameToEntry(java.lang.String className)
className
- the name of the class to findprotected java.util.Enumeration getClassPathDirs()
public static void main(java.lang.String[] args) throws java.lang.Exception
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |