public final class Resources extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CONFIG_PATH
Path to config files, within the resources area.
|
static String |
CONFIG_SUBPATH
Subpath to config files, within the resources area.
|
static String |
IMAGES_PATH
Path to images, within the resources area.
|
static String |
IMAGES_SUBPATH
Subpath to images, within the resources area.
|
static String |
RESOURCE_PATH
Base path to resources.
|
Modifier and Type | Method and Description |
---|---|
static Icon |
getIcon(String iconFileName)
Returns an Icon from the specified filename.
|
static Properties |
getProperties(String fileName)
Loads an installed
Properties file. |
static URL |
getResource(String resource)
Gets a URL associated with the given resource.
|
static InputStream |
getResourceAsStream(String resource)
Gets a resource as an
InputStream . |
public static final String RESOURCE_PATH
public static final String IMAGES_SUBPATH
public static final String IMAGES_PATH
public static final String CONFIG_SUBPATH
public static final String CONFIG_PATH
public static URL getResource(String resource)
public static InputStream getResourceAsStream(String resource)
InputStream
.public static Icon getIcon(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 Properties getProperties(String fileName) throws IOException
Properties
file.fileName
- relative path to the configuration file (which must be
loadable by the java.util.Properties
class)IOException
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.