|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object wyvern.common.tiles.FileCache
Serves up image files as byte arrays, for sending to clients. Keeps an in-memory cache of files that have already been loaded.
Constructor Summary | |
FileCache()
|
Method Summary | |
static long |
getTimestamp(java.lang.String path)
Retrieves the last-modified "date" for a file. |
static byte[] |
loadFile(java.lang.String path)
Synchronously reads the bytes of the specified file. |
static byte[] |
readFileBytes(java.lang.String filepath)
Until I know whether our own file cache is really necessary, I'm going to rely on the disk cache being fast. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public FileCache()
Method Detail |
public static byte[] loadFile(java.lang.String path) throws java.io.IOException
path
- relative path to the image file. If it starts
with "wiz/", looks under the wiz dir, else looks under the
default artwork dir.
java.io.IOException
public static byte[] readFileBytes(java.lang.String filepath) throws java.io.IOException
filepath
- the absolute path to the file
java.io.IOException
public static long getTimestamp(java.lang.String path)
path
- the relative path to the art file
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |