public class JarResource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
JAVA_DUKE_IMAGE_NAME |
private static Logger |
log |
Constructor and Description |
---|
JarResource() |
Modifier and Type | Method and Description |
---|---|
static void |
delete(java.lang.String resourceName) |
static java.lang.String |
export(java.lang.String resourceName)
Export a resource embedded into a Jar file to the local file path.
|
static java.awt.image.BufferedImage |
loadImage(java.lang.String resourceName)
Obtain an image stored as a resource embedded into this Jar.
|
static byte[] |
read(java.lang.String resourceName)
Read a resource embedded into this Jar.
|
static java.io.InputStream |
stream(java.lang.String resourceName)
Obtain a stream to a resource embedded into this Jar.
|
public static final java.lang.String JAVA_DUKE_IMAGE_NAME
private static final Logger log
public static java.io.InputStream stream(java.lang.String resourceName)
resourceName
- "Sound.wav"public static java.awt.image.BufferedImage loadImage(java.lang.String resourceName) throws java.io.IOException
resourceName
- "logo.png"java.io.IOException
public static byte[] read(java.lang.String resourceName)
resourceName
- "Sound.wav"public static java.lang.String export(java.lang.String resourceName) throws java.io.IOException
resourceName
- "Sound.wav"java.lang.Exception
- When URI parsing fails or IO exception happensjava.io.IOException
public static void delete(java.lang.String resourceName)