MAEPlugin
Class JarResources

java.lang.Object
  |
  +--MAEPlugin.JarResources

public final class JarResources
extends java.lang.Object

JarResources: JarResources maps all resources included in a Zip or Jar file. Additionaly, it provides a method to extract one as a blob. This is generic Java code taken from various sources and modified.

This work was produced by Peter Lemkin of the National Cancer Institute, an agency of the United States Government. As a work of the United States Government there is no associated copyright. It is offered as open source software under the Mozilla Public License (version 1.1) subject to the limitations noted in the accompanying LEGAL file. This notice must be included with the code. The MAExplorer Mozilla and Legal files are available on http://maexplorer.sourceforge.net/.

Version:
$Date: 2002/10/13 17:39:33 $ $Revision: $
Author:
Jai Evans(DECA/CIT), P. Lemkin (NCI), NCI-Frederick, Frederick, MD
See Also:
MAExplorer Home

Constructor Summary
JarResources(java.lang.String jarFileName)
          JarResources() - constructor for createing a JarResources.
 
Method Summary
 byte[] getResource(java.lang.String name)
          getResource() - Extracts a jar resource as a blob.
 boolean isResource(java.lang.String name)
          isResource() - checks to see if resource exists
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JarResources

public JarResources(java.lang.String jarFileName)
JarResources() - constructor for createing a JarResources. It extracts all resources from a Jar into an internal hashtable, keyed by resource names.
Parameters:
jarFileName - a jar or zip file
Method Detail

getResource

public byte[] getResource(java.lang.String name)
getResource() - Extracts a jar resource as a blob.
Parameters:
name - a resource name.
Returns:
bytes of resource

isResource

public boolean isResource(java.lang.String name)
isResource() - checks to see if resource exists
Parameters:
name - a resource name.
Returns:
true if key exists in hash table resource