org.gloin.resource
Class FileByteStore
java.lang.Object
|
+--org.gloin.resource.FileByteStore
- All Implemented Interfaces:
- ByteStore
- public class FileByteStore
- extends java.lang.Object
- implements ByteStore
ByteStore
that stores and retrieves class files from a
local file system. This code is based on the code retrieval
capabilities of the http code server that ships with the JSK.
Method Summary |
byte[] |
getBytes(java.lang.String pathName)
Return the bytes of the requested file. |
java.lang.String[] |
list()
|
void |
removeBytes(java.lang.String pathName)
|
boolean |
resourceFilled(java.lang.String resourceName)
|
void |
saveBytes(java.lang.String pathName,
byte[] bytes,
int replace)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FileByteStore
public FileByteStore()
throws java.io.IOException
FileByteStore
public FileByteStore(java.lang.String dir,
boolean verbose)
throws java.io.IOException
- Parameters:
dir
- the directory to serve files fromverbose
- true if downloads should be logged
resourceFilled
public boolean resourceFilled(java.lang.String resourceName)
throws java.io.IOException
list
public java.lang.String[] list()
throws java.io.IOException
- Specified by:
list
in interface ByteStore
saveBytes
public void saveBytes(java.lang.String pathName,
byte[] bytes,
int replace)
throws java.io.IOException
- Specified by:
saveBytes
in interface ByteStore
removeBytes
public void removeBytes(java.lang.String pathName)
throws java.io.IOException
- Specified by:
removeBytes
in interface ByteStore
getBytes
public byte[] getBytes(java.lang.String pathName)
throws java.io.IOException
- Return the bytes of the requested file.
- Specified by:
getBytes
in interface ByteStore