|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectinfo.aduna.io.ResourceUtil
public class ResourceUtil
ResourceUtil is a utility class for retrieving resources (images, property-files, etc) from the classpath.
| Constructor Summary | |
|---|---|
ResourceUtil()
|
|
| Method Summary | |
|---|---|
static BufferedImage |
getImage(String resourceName)
Retrieve an image resource |
static ImageIcon |
getImageIcon(String resourceName)
Retrieve an image icon resource. |
static InputStream |
getInputStream(String resourceName)
Get an inputstream on the specified resource. |
static Properties |
getProperties(String resourceName)
Retrieve a properties resource. |
static String |
getString(String resourceName)
Retrieve the String contents of the specified resource, obtained by opening in inputstream on the resource and then interpreting the bytes contained in the inputstream as if they represented characters. |
static URL |
getURL(String resourceName)
The the URL to the specified resource |
static Set<URL> |
getURLs(String resourceName)
|
static void |
resourceToFile(String resourceName,
File output)
Store a resource to a file on the file system. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ResourceUtil()
| Method Detail |
|---|
public static URL getURL(String resourceName)
resourceName - the name of the resource
public static Set<URL> getURLs(String resourceName)
throws IOException
IOExceptionpublic static InputStream getInputStream(String resourceName)
resourceName - the name of the resource
public static String getString(String resourceName)
throws IOException
resourceName - the name of the resource
IOException - when something goes wrong trying to read the resourcepublic static ImageIcon getImageIcon(String resourceName)
resourceName - the name of the resource
public static BufferedImage getImage(String resourceName)
resourceName - the name of the resource
public static Properties getProperties(String resourceName)
throws IOException
resourceName - the name of the resource
IOException
public static void resourceToFile(String resourceName,
File output)
throws IOException
resourceName - the name of the resourceoutput - the file to write to
IOException - if there was a problem reading the resource or writing to the file
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||