All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jHelp.htmlLocator

java.lang.Object
   |
   +----jHelp.htmlLocator

public class htmlLocator
extends Object
A convenience class with static methods to permit determining the name of the application's jar or zip file, and the path to a specified resource.

Using these methods, help documents can be packed in an application's jar file and then extracted by first getting the filespec of the jar using the getZip method, and then the path of the resource within the jar using the getPath method.

These methods also work for non-jar'd packages, in which case getZip returns null, and get path returns the absolute path to the resource(s) on the users drive.


Constructor Index

 o htmlLocator()

Method Index

 o getPath(Class, String)
Return the path of the specified resource within the jar or zip, or if not in a jar, the absolute path to the resource in the user's file system.
 o getZip(Class, String)
Return the absolute file spec of the jar or zip associated with the classObject parameter and the name of any resource known to be contained within the jar.

Constructors

 o htmlLocator
 public htmlLocator()

Methods

 o getZip
 public static String getZip(Class classObject,
                             String aResource)
Return the absolute file spec of the jar or zip associated with the classObject parameter and the name of any resource known to be contained within the jar. Returns null if the classObject is not contained in a jar or zip.

Parameters:
classObject - the class object, obtained with getClass()
aResource - the name of any resource, i.e a help doc name known to be contained within the jar or zip.
 o getPath
 public static String getPath(Class classObject,
                              String aResource)
Return the path of the specified resource within the jar or zip, or if not in a jar, the absolute path to the resource in the user's file system. Returns null if the resource cannot be located.

Parameters:
classObject - the class object, obtained with getClass()
aResource - the name of any resource, i.e a help doc name known to be contained within the jar or zip.

All Packages  Class Hierarchy  This Package  Previous  Next  Index