org.apache.env

Class WhichJar

public abstract class WhichJar extends Object

Static worker methods to find version info about jars and classpaths.

Version: $Id: WhichJar.java 225939 2001-12-11 17:42:50Z curcuru $

Author: shane_curcuru@us.ibm.com

Field Summary
protected static PropertiesjarSizeTable
A Properties block of known officially shipped .jar names/sizes.
static StringSERVICE_NAME
SERVICE_NAME.
Method Summary
static voidgetClasspathInfo(Hashtable hash, String options)
Generic worker method to print out java.class.path, sun.boot.class.path, and java.ext.dirs.
static intgetInfo(Hashtable hash, File jarFile, String options)
Get version information about a specific .jar file.
static StringgetVersion()
Get our file version info.
static intsearchClasspaths(Hashtable hash, String jarName, String options)
Search all applicable classpath-like items for the named jar.
static intsearchDir(Hashtable hash, String dir, String jarName, String options)
Search a single directory for the named jar.
static intsearchDirs(Hashtable hash, String pathName, String jarName, String options)
Search a list of paths for the named jar.
static intsearchPath(Hashtable hash, String pathName, String jarName, String options)
Search a classpath path for the named jar.

Field Detail

jarSizeTable

protected static Properties jarSizeTable
A Properties block of known officially shipped .jar names/sizes.

SERVICE_NAME

public static final String SERVICE_NAME
SERVICE_NAME.

Method Detail

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.

Parameters: hash to put information in options 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!).

Parameters: hash to put information in jarName of the .jar file options to apply like strict or verbose

Returns: status information from WhichConstant

getVersion

public static String getVersion()
Get our file version info.

Returns: 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.

Parameters: hash to put information in jarName to look for options to apply like strict or verbose

Returns: 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.

Parameters: hash to put information in dir name of directory jarName to look for, case-insensitive options to apply like strict or verbose

Returns: 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.

Parameters: hash to put information in pathName to get from System.getProperty() jarName to look for, case-insensitive options to apply like strict or verbose

Returns: 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.

Parameters: hash to put information in pathName to get from System.getProperty() jarName to look for, case-insensitive options to apply like strict or verbose

Returns: status information from WhichConstant

Copyright B) 2001 Apache. All Rights Reserved.