Class ClassPath
- java.lang.Object
-
- com.sun.jdo.api.persistence.enhancer.util.ClassPath
-
public class ClassPath extends Object
ClassPath provides class file lookup according to a classpath specification.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
append(com.sun.jdo.api.persistence.enhancer.util.ClassPathElement anElement)
Append a class path element to the classpath.void
append(File directory)
Append a directory to the classpath.Enumeration
classesInPackage(String packageName)
Return an enumeration of all of the class files in the specified package in this class path.static String
classNameOf(String fileName)
Return the vm class name which corresponds to the input file name.static String
fileNameOf(String className)
Return a file name which might reasonably identify a file containing the specified class.static String
fileNameOf(String className, char separator)
Return a file name which might reasonably identify a file containing the specified class.ClassFileSource
findClass(String className)
locate a class file given a fully qualified class nameboolean
remove(File directory)
Remove any class path elements which match directorystatic String
zipFileNameOf(String className)
Return a file name which might reasonably identify a file containing the specified class in a zip file.
-
-
-
Constructor Detail
-
ClassPath
public ClassPath(String path)
Construct a class path from the input String argument. The path is expected to be in the form appropriate for the current execution environment.
-
-
Method Detail
-
findClass
public ClassFileSource findClass(String className)
locate a class file given a fully qualified class name
-
fileNameOf
public static String fileNameOf(String className, char separator)
Return a file name which might reasonably identify a file containing the specified class. The name is a "./" relative path.
-
fileNameOf
public static String fileNameOf(String className)
Return a file name which might reasonably identify a file containing the specified class. The name is a "./" relative path.
-
zipFileNameOf
public static String zipFileNameOf(String className)
Return a file name which might reasonably identify a file containing the specified class in a zip file.
-
classNameOf
public static String classNameOf(String fileName)
Return the vm class name which corresponds to the input file name. The file name is expected to be a "./" relative path. Returns null if the file name doesn't end in ".class"
-
remove
public boolean remove(File directory)
Remove any class path elements which match directory
-
append
public void append(File directory)
Append a directory to the classpath.
-
append
public void append(com.sun.jdo.api.persistence.enhancer.util.ClassPathElement anElement)
Append a class path element to the classpath.
-
classesInPackage
public Enumeration classesInPackage(String packageName)
Return an enumeration of all of the class files in the specified package in this class path.- Parameters:
packageName
- specifies the VM format package name to which class files must belong.- Returns:
- an Enumeration of the VM format class names which can be found. Note that the Enumeration value is of type String and duplicate entries may be returned as the result of finding a class through more than one class path element. Note also that the class name returned might not correspond the the name of the class in the file.
-
-