public class Resource
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
encoding |
Constructor and Description |
---|
Resource(java.io.File file)
Constructs a resource from a file.
|
Resource(java.net.URL url)
Constructs a resource from a url.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAbsolutePath()
Gets the absolute path.
|
java.applet.AudioClip |
getAudioClip()
Gets an AudioClip.
|
java.awt.image.BufferedImage |
getBufferedImage()
Gets a buffered image.
|
java.io.File |
getFile()
Gets the file associated with this resource.
|
javax.swing.ImageIcon |
getIcon()
Gets an ImageIcon.
|
java.awt.Image |
getImage()
Gets an Image.
|
java.lang.Object |
getObject(java.lang.Class type)
Gets an object of the specified type.
|
java.lang.String |
getString()
Gets a String.
|
java.net.URL |
getURL()
Gets the url associated with this resource.
|
java.io.InputStream |
openInputStream()
Opens an InputStream.
|
java.io.BufferedReader |
openReader()
Opens a BufferedReader.
|
public Resource(java.net.URL url)
url
- the URLpublic Resource(java.io.File file)
file
- the filepublic java.lang.String getAbsolutePath()
public java.net.URL getURL()
public java.io.File getFile()
public java.lang.Object getObject(java.lang.Class type)
type
- the desired class typepublic java.io.InputStream openInputStream()
public java.io.BufferedReader openReader()
public javax.swing.ImageIcon getIcon()
public java.awt.Image getImage()
public java.awt.image.BufferedImage getBufferedImage()
public java.lang.String getString()
public java.applet.AudioClip getAudioClip()