|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjsky.util.Resources
public final class Resources
Resources provides a central class with methods for accessing project resources.
Field Summary | |
---|---|
static java.lang.String |
CONFIG_PATH
Path to config files, within the resources area. |
static java.lang.String |
CONFIG_SUBPATH
Subpath to config files, within the resources area. |
static java.lang.String |
IMAGES_PATH
Path to images, within the resources area. |
static java.lang.String |
IMAGES_SUBPATH
Subpath to images, within the resources area. |
static java.lang.String |
RESOURCE_PATH
Base path to resources. |
Method Summary | |
---|---|
static javax.swing.Icon |
getIcon(java.lang.String iconFileName)
Returns an Icon from the specified filename. |
static java.util.Properties |
getProperties(java.lang.String fileName)
Loads an installed Properties file. |
static java.net.URL |
getResource(java.lang.String resource)
Gets a URL associated with the given resource. |
static java.io.InputStream |
getResourceAsStream(java.lang.String resource)
Gets a resource as an InputStream . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String RESOURCE_PATH
public static final java.lang.String IMAGES_SUBPATH
public static final java.lang.String IMAGES_PATH
public static final java.lang.String CONFIG_SUBPATH
public static final java.lang.String CONFIG_PATH
Method Detail |
---|
public static java.net.URL getResource(java.lang.String resource)
public static java.io.InputStream getResourceAsStream(java.lang.String resource)
InputStream
.
public static javax.swing.Icon getIcon(java.lang.String iconFileName)
iconFileName
- The relative path name to the image file.
For example, "flag.gif". It is assumed the image file is
being properly installed to the resources directory.
iconFileName
.
Even though the method interface can't guarentee this, the icon
implementation will be Serializable
.
Returns null (does not throw an Exception) if specified
resource is not found.public static java.util.Properties getProperties(java.lang.String fileName) throws java.io.IOException
Properties
file.
fileName
- relative path to the configuration file (which must be
loadable by the java.util.Properties
class)
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |