|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.princeton.toy.TResourceLoader
public abstract class TResourceLoader
TResourceLoader is a convenient library of functions which allow the other classes to easily access resources from within the JAR file. In centralizing all resource loading, we also give ourselves the ability to change the implementation easily.
Constructor Summary | |
---|---|
TResourceLoader()
|
Method Summary | |
---|---|
static BufferedReader |
getBufferedReader(String path)
Returns the BufferedReader object for a JARed file. |
static Image |
getImage(String path)
Returns the Image object for a JARed picture. |
static InputStream |
getInputStream(String path)
Returns the InputStream object for a JARed file. |
static Reader |
getReader(String path)
Returns the Reader object for a JARed file. |
static URL |
getUrl(String path)
Returns the URL object for a JARed resource. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TResourceLoader()
Method Detail |
---|
public static URL getUrl(String path)
path
- The path of the resource relative to the root of the JAR archive.
public static Image getImage(String path)
path
- The path of the picture relative to the root of the JAR archive.
public static InputStream getInputStream(String path) throws IOException
path
- The path of the file relative to the root of the JAR archive.
IOException
public static Reader getReader(String path) throws IOException
path
- The path of the file relative to the root of the JAR archive.
IOException
public static BufferedReader getBufferedReader(String path) throws IOException
path
- The path of the file relative to the root of the JAR archive.
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |