org.apache.env
Class WhichJar
public abstract class WhichJar
extends java.lang.Object
Static worker methods to find version info about jars and classpaths.
Version:
- shane_curcuru@us.ibm.com
static String | SERVICE_NAME - SERVICE_NAME.
|
protected static Properties | jarSizeTable - A Properties block of known officially shipped .jar names/sizes.
|
static void | getClasspathInfo(Hashtable hash, String options) - Generic worker method to print out java.class.path,
sun.boot.class.path, and java.ext.dirs.
|
static int | getInfo(Hashtable hash, File jarFile, String options) - Get version information about a specific .jar file.
|
static String | getVersion() - Get our file version info.
|
static int | searchClasspaths(Hashtable hash, String jarName, String options) - Search all applicable classpath-like items for the named jar.
|
static int | searchDir(Hashtable hash, String dir, String jarName, String options) - Search a single directory for the named jar.
|
static int | searchDirs(Hashtable hash, String pathName, String jarName, String options) - Search a list of paths for the named jar.
|
static int | searchPath(Hashtable hash, String pathName, String jarName, String options) - Search a classpath path for the named jar.
|
SERVICE_NAME
public static final String SERVICE_NAME
SERVICE_NAME.
jarSizeTable
protected static Properties jarSizeTable
A Properties block of known officially shipped .jar names/sizes.
getClasspathInfo
public static void getClasspathInfo(Hashtable hash,
String options)
Generic worker method to print out java.class.path,
sun.boot.class.path, and java.ext.dirs.
hash
- to put information inoptions
- to apply like strict or verbose
getInfo
public static int getInfo(Hashtable hash,
File jarFile,
String options)
Get version information about a specific .jar file.
Current implementation simply checks the file size in bytes
of the .jar file and does a lookup in WhichJar.properties
to get a description of officially shipped .jars.
//@todo future versions should also lookup manifest
version info from .jar files (but remember to provide
fallbacks since we must also run on JDK 1.1.8!).
hash
- to put information inoptions
- to apply like strict or verbose
- status information from WhichConstant
getVersion
public static String getVersion()
Get our file version info.
- String of our file version
searchClasspaths
public static int searchClasspaths(Hashtable hash,
String jarName,
String options)
Search all applicable classpath-like items for the named jar.
Looks in each classpath (and bootclasspath, and ext dirs)
for the jar and reports info about it.
hash
- to put information injarName
- to look foroptions
- to apply like strict or verbose
- status information from WhichConstant
searchDir
public static int searchDir(Hashtable hash,
String dir,
String jarName,
String options)
Search a single directory for the named jar.
hash
- to put information indir
- name of directoryjarName
- to look for, case-insensitiveoptions
- to apply like strict or verbose
- status information from WhichConstant
searchDirs
public static int searchDirs(Hashtable hash,
String pathName,
String jarName,
String options)
Search a list of paths for the named jar.
hash
- to put information inpathName
- to get from System.getProperty()jarName
- to look for, case-insensitiveoptions
- to apply like strict or verbose
- status information from WhichConstant
searchPath
public static int searchPath(Hashtable hash,
String pathName,
String jarName,
String options)
Search a classpath path for the named jar.
hash
- to put information inpathName
- to get from System.getProperty()jarName
- to look for, case-insensitiveoptions
- to apply like strict or verbose
- status information from WhichConstant
Copyright B) 2001 Apache. All Rights Reserved.