|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sapia.filestorm.http.StoreClient
public class StoreClient
An instance of this class encapsulates access to a
StoreServlet.
| Nested Class Summary | |
|---|---|
static class |
StoreClient.StoreClientInputStream
|
| Field Summary |
|---|
| Fields inherited from interface org.sapia.filestorm.http.Proto |
|---|
HEADER_SAPIA_STORE_OP, OP_CONTAINS, OP_CONTENT_LEN, OP_LAST_MODIFIED, OP_LIST |
| Constructor Summary | |
|---|---|
StoreClient(String url,
int bufsize)
|
|
| Method Summary | |
|---|---|
void |
close()
Closes this instance. |
boolean |
contains(String name)
|
void |
delete(String name)
|
InputStream |
get(String name)
|
void |
get(String name,
OutputStream os)
Streams the data corresponding to the given name into the given stream. |
long |
getContentLength(String name)
|
long |
getLastModified(String name)
|
String[] |
list(String baseName)
Returns the list of names corresponding to stored data, relative to the given base name. |
void |
put(String name,
InputStream is)
Stores the data corresponding to the given stream under the named passed in. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StoreClient(String url,
int bufsize)
url - the URL of the StoreServlet to connect to.bufsize - the size of the internal buffers that are used for data transfer.| Method Detail |
|---|
public void close()
Store
close in interface Store
public boolean contains(String name)
throws IOException
contains in interface Storename - the name corresponding to the data whose existence must be checked.
IOException
public String[] list(String baseName)
throws IOException
Storesome/path/to/file,
the file fragment will be relative to some/path/to (therefore,
passing some/path/to as a base name to this method would return all names
immediately "under" that base name).
If the passed in base name is null or is an empty string, then the returned
names will be returned relatively to the "root" of this instance.
list in interface StorebaseName - a base name.
IOException
public long getContentLength(String name)
throws FileNotFoundException,
IOException
getContentLength in interface Storename - the name corresponding to the data whose length must be returned.
FileNotFoundException
IOException
public long getLastModified(String name)
throws FileNotFoundException,
IOException
getLastModified in interface Storename - the name corresponding to the data whose timestamp must be returned..
millis, at which the data was last modified.
FileNotFoundException
IOException
public void delete(String name)
throws IOException
delete in interface Storename - the name corresponding to the data to delete.
IOException - if an IO problem occurs while performing this operation.
public void get(String name,
OutputStream os)
throws IOException,
FileNotFoundException
Store
get in interface Storename - the name corresponding to the data to retrieve.os - an OutputStream to which the data is to be written.
IOException - if an IO problem occurs while performing this operation.
FileNotFoundException - if no data exists for the given name.
public InputStream get(String name)
throws IOException,
FileNotFoundException
get in interface Storename - the name corresponding to the data to retrieve.
IOException - if an IO problem occurs while performing this operation.
FileNotFoundException - if no data exists for the given name.
public void put(String name,
InputStream is)
throws IOException
Store
put in interface Storename - the name under which to keep the passed in data.is - an InputStream containing data to save.
IOException - if an IO problem occurs while performing this operation.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||