|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjfreerails.util.ClassPath
public class ClassPath
ClassPath finds and records the fully qualified name of every Class on the classpath via the system property "java.class.path".
Based on original prototype by duncanIdaho for javagaming.org.
| Field Summary | |
|---|---|
protected java.util.LinkedList<java.io.File> |
jarsThatHAveAlreadyBeenProcessed
|
protected java.util.logging.Logger |
logger
|
protected java.util.LinkedList<java.lang.String> |
pathElementsThatHaveAlreadyBeenProcessed
|
| Constructor Summary | |
|---|---|
ClassPath()
create a new ClassPath instance and find all classes on the classpath |
|
| Method Summary | |
|---|---|
protected java.lang.String |
convertToClass(java.io.File classFile)
|
protected java.util.LinkedList<java.lang.String> |
findPathElementsInJar(java.util.jar.Manifest man,
java.util.jar.JarFile jar,
java.io.File jarFile)
Finds all path elements in the supplied JAR and returns them as a list |
java.util.List |
getAllClassNames()
|
private java.lang.String |
getClassNameFrom(java.lang.String entryName)
replace ANY slashes with dots and remove the .class at the end of the file name. |
protected java.util.LinkedList<java.lang.String> |
getDirectoryContents(java.io.File dir)
This method takes a top level classpath dir i.e. |
protected java.util.LinkedList<java.lang.String> |
getDirectoryContents(java.lang.String pathTo,
java.io.File dir)
This method does the real directory recursion, passing along the the corresponding package-path to this directory. |
protected java.util.LinkedList<java.lang.String> |
getZipContents(java.io.File zipFile)
Adds all class names found in the zip mentioned |
protected java.util.LinkedList<java.lang.String> |
processPendingElement(java.lang.String pathElement)
Clones the supplied list, then goes through it processing every element. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.util.logging.Logger logger
protected java.util.LinkedList<java.lang.String> pathElementsThatHaveAlreadyBeenProcessed
protected java.util.LinkedList<java.io.File> jarsThatHAveAlreadyBeenProcessed
| Constructor Detail |
|---|
public ClassPath()
| Method Detail |
|---|
public java.util.List getAllClassNames()
protected java.util.LinkedList<java.lang.String> processPendingElement(java.lang.String pathElement)
protected java.lang.String convertToClass(java.io.File classFile)
classFile - a class file listed on the classpath itself.private java.lang.String getClassNameFrom(java.lang.String entryName)
entryName - a file name relative to the classpath. A class of package org
found in directory bin would be passed into this method as
"org/MyClass.class"
protected java.util.LinkedList<java.lang.String> findPathElementsInJar(java.util.jar.Manifest man,
java.util.jar.JarFile jar,
java.io.File jarFile)
man - the manifest of the given jarjar - the jar associated with the given manifest.protected java.util.LinkedList<java.lang.String> getZipContents(java.io.File zipFile)
zipFile - protected java.util.LinkedList<java.lang.String> getDirectoryContents(java.io.File dir)
dir -
protected java.util.LinkedList<java.lang.String> getDirectoryContents(java.lang.String pathTo,
java.io.File dir)
pathTo - the preceding path to this directorydir - a directory to search for class files
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||