edu.mit.ai.psg.jeva
Class ClassPathMethods
java.lang.Object
|
+--edu.mit.ai.psg.jeva.ClassPathMethods
- public class ClassPathMethods
- extends Object
ClassPathMethods.findInClassPath searches classpath to obtain an input
stream from either source directories or jar files.
ClassPathMethods.verifyPackageNameFromClassPath checks that a directory
structure or jar file entry exists corresponding to a package name
starting from some root in the class path.
- Author:
- CarlManning, caroma@ai.mit.edu
Copyright (c) 1997, 1998 Massachusetts Institute of Technology
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
checkPackageNames
public static boolean checkPackageNames
ClassPathMethods
public ClassPathMethods()
getClassPathStrings
public static Vector getClassPathStrings()
dotsToSeparators
public static String dotsToSeparators(String input)
- for example, if separator char is '/', then converts "java.io.File" to
"java/io/File". For now, assumes separator is single character:
if File.separator.length() != 1, throws Error
dotsToSeparators
public static String dotsToSeparators(String input,
char separatorChar)
findSourceInClassPath
public static ClassPathMethods.ClassPathSearchResult findSourceInClassPath(String fullClassName)
- classfilename should end in appropriate suffix, .java or .class, and
should already have package "."'s converted to java.io.File.separator.
Returns an input stream so it can work on .jar files as well as
directories in classpath.
- Returns:
- ClassPathMethods.ClassPathSearchResult
to return multiple values; has fields
public String locationPath;
public InputStream stream;
public long modificationDate;
findBytecodesInClassPath
public static ClassPathMethods.ClassPathSearchResult findBytecodesInClassPath(String fullClassName)
findInClassPath
public static ClassPathMethods.ClassPathSearchResult findInClassPath(Vector classPathStrings,
String fullClassName,
String suffix)
verifyPackageNameFromClassPath
public static boolean verifyPackageNameFromClassPath(String fullPackageName)
- Verify there is a file system directory or zipfile directory in
the classpath which corresponds to the package name.
- See Also:
clearCaches()
verifyPackageNameFromClassPath
public static boolean verifyPackageNameFromClassPath(Vector classPathStrings,
String fullPackageName)
clearCaches
public static void clearCaches()
- clear caches. Only needed if jar files are rewritten or
directory structure in classpath is changed.