dk.brics.bisim
Class JarResources

java.lang.Object
  extended by dk.brics.bisim.JarResources

public class JarResources
extends java.lang.Object

A class for reading resources from a jar file. Inspired by JavaWorld Tip 49

Author:
Martin Mosegaard martinm@daimi.au.dk

Field Summary
static java.lang.String ABOUT_URL
          Name of the HTML file displayed in the About view.
static java.lang.String GAME_FILE
          Name of the image shown in the Help view.
static java.lang.String HELP_URL
          Name of the HTML file displayed in the Help view.
static java.lang.String IT_VEST_FILE
          Name of the it-vest logo image.
static java.lang.String JAR_FILE
          Name of the jar file.
static java.lang.String LOSER_FILE
          Name of the loser smiley image.
protected static java.lang.String POLICY_FILE
          Name of the security policy file.
static java.lang.String SPLASH_FILE
          Name of the image in the options menu.
static java.lang.String WINNER_FILE
          Name of the winner smiley image.
 
Constructor Summary
JarResources()
           
 
Method Summary
static byte[] getResource(java.lang.String jarFileName, java.lang.String resourceName)
          Tries to open a jar file, extract a given resource and return the resource data as a byte array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

JAR_FILE

public static final java.lang.String JAR_FILE
Name of the jar file.

See Also:
Constant Field Values

POLICY_FILE

protected static final java.lang.String POLICY_FILE
Name of the security policy file.

See Also:
Constant Field Values

SPLASH_FILE

public static final java.lang.String SPLASH_FILE
Name of the image in the options menu.

See Also:
Constant Field Values

WINNER_FILE

public static final java.lang.String WINNER_FILE
Name of the winner smiley image.

See Also:
Constant Field Values

LOSER_FILE

public static final java.lang.String LOSER_FILE
Name of the loser smiley image.

See Also:
Constant Field Values

IT_VEST_FILE

public static final java.lang.String IT_VEST_FILE
Name of the it-vest logo image.

See Also:
Constant Field Values

GAME_FILE

public static final java.lang.String GAME_FILE
Name of the image shown in the Help view.

See Also:
Constant Field Values

HELP_URL

public static final java.lang.String HELP_URL
Name of the HTML file displayed in the Help view.

See Also:
Constant Field Values

ABOUT_URL

public static final java.lang.String ABOUT_URL
Name of the HTML file displayed in the About view.

See Also:
Constant Field Values
Constructor Detail

JarResources

public JarResources()
Method Detail

getResource

public static byte[] getResource(java.lang.String jarFileName,
                                 java.lang.String resourceName)
Tries to open a jar file, extract a given resource and return the resource data as a byte array.

Parameters:
jarFileName - Name of the jar file
resourceName - Name of the resource file
Returns:
A byte array representation of a jar resource