|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectthredds.util.Resource
public class Resource
Cover for fetching files using Class.getResource(). If the application is started from a jar file, then it looks in there. If the application is started from a class file, then it looks in the disk file heirarchy, using directories in the classpath as root(s). 1. Filenames. use "/" as path seperator when embedded in a string. This works on both Windows and Unix. 2. Filepath. Use a resourcePath starting with a forward slash. getResource() then searches relative to the classpath. otherwise it will search reletive to ucar.unidata.util, which is probably not what you want.
| Constructor Summary | |
|---|---|
Resource()
|
|
| Method Summary | |
|---|---|
static java.io.InputStream |
getFileResource(java.lang.String resourcePath)
Open a resource as a Stream. |
static javax.swing.ImageIcon |
getIcon(java.lang.String fullIconName,
boolean errMsg)
Get a gif file, make it into an ImageIcon. |
static java.awt.Image |
getImage(java.lang.String fullImageName)
Get a gif file, make it into an Image. |
static java.net.URL |
getURL(java.lang.String filename)
Get a file as a URL |
static void |
main(java.lang.String[] args)
testing |
static java.awt.Cursor |
makeCursor(java.lang.String name)
Get a gif file, make it into a Cursor. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Resource()
| Method Detail |
|---|
public static javax.swing.ImageIcon getIcon(java.lang.String fullIconName,
boolean errMsg)
fullIconName - full path name of gif file (use forward slashes!)errMsg - print err message on failure
public static java.awt.Image getImage(java.lang.String fullImageName)
fullImageName - full path name of gif file (use forward slashes!)
public static java.net.URL getURL(java.lang.String filename)
filename - full path name of file (use forward slashes!)
public static java.awt.Cursor makeCursor(java.lang.String name)
name - full path name of gif file (use forward slashes!)
public static java.io.InputStream getFileResource(java.lang.String resourcePath)
resourcePath - name of file path (use forward slashes!)
public static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||