Class JESResources

java.lang.Object
  extended by JESResources

public class JESResources
extends java.lang.Object

This manages JES resources which live under the jes.home directory.


Constructor Summary
JESResources()
           
 
Method Summary
static java.io.File getFileFor(java.lang.String path)
          Returns a File identifying a resource in the JES home directory, and verifies that it exists.
static java.lang.String getHomePath()
          Returns the configured JES home directory.
static java.lang.String getPathTo(java.lang.String path)
          Returns the pathname for a resource in the JES home directory, and verifies that it exists.
static javax.swing.ImageIcon makeIcon(java.lang.String path)
          Returns a Swing ImageIcon using a particular resource in the JES home directory.
static javax.swing.ImageIcon makeIcon(java.lang.String path, java.lang.String description)
          Returns a Swing ImageIcon using a particular resource in the JES home directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JESResources

public JESResources()
Method Detail

getHomePath

public static java.lang.String getHomePath()
Returns the configured JES home directory.

Returns:
The path to the home directory, or null if one is not configured in the jes.home property.

getFileFor

public static java.io.File getFileFor(java.lang.String path)
Returns a File identifying a resource in the JES home directory, and verifies that it exists.

Parameters:
path - The path to the resource, relative to the JES home, without a leading /.
Returns:
A File for the resource.
Throws:
java.lang.IllegalStateException - If the JES home is not configured, or the file is not installed.

getPathTo

public static java.lang.String getPathTo(java.lang.String path)
Returns the pathname for a resource in the JES home directory, and verifies that it exists.

Parameters:
path - The path to the resource, relative to the JES home, without a leading /.
Returns:
An absolute path for the resource.
Throws:
java.lang.IllegalStateException - If the JES home is not configured, or the file is not installed.

makeIcon

public static javax.swing.ImageIcon makeIcon(java.lang.String path)
Returns a Swing ImageIcon using a particular resource in the JES home directory.

Parameters:
path - The path to the resource, without a leading /.
Returns:
An ImageIcon using that resource as its file.
Throws:
java.lang.IllegalStateException - If the JES home is not configured, or the file is not installed.

makeIcon

public static javax.swing.ImageIcon makeIcon(java.lang.String path,
                                             java.lang.String description)
Returns a Swing ImageIcon using a particular resource in the JES home directory.

Parameters:
path - The path to the resource, without a leading /.
description - A description for the icon.
Returns:
An ImageIcon using that resource as its file.
Throws:
java.lang.IllegalStateException - If the JES home is not configured, or the file is not installed.