|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
This interface defines generic data access methods for resources. Wherever addresses are involved in creating new resources, all non-existing collections in the specified path to the resource will be created automatically.
Each of the methods throws a subset of the following exceptions:
| Method Summary | |
boolean |
canRead(String address)
Check if the resource specified by the address can be read. |
boolean |
canWrite(String address)
Check if the resource specified by the address can be written to. |
boolean |
deleteResource(String address)
Delete a resource if it exists. |
BufferedInputStream |
getInputStream(String address)
Create and return a BufferedInputStream for the resource. |
BufferedOutputStream |
getOutputStream(String address)
Create and return a BufferedOutputStream for the resource. |
BufferedOutputStream |
getOutputStream(String address,
boolean append)
Create and return a (possibly append-only) BufferedOutputStream for the resource. |
boolean |
renameResource(String srcAddress,
String destAddress,
boolean force)
Move or rename a resource from one address to another. |
boolean |
storeResource(String address,
BufferedInputStream source,
boolean force)
Create a new resource with the content from the source. |
| Method Detail |
public boolean canRead(String address)
throws MalformedAddressException,
IOException
address - address of the resource
MalformedAddressException
IOException
public boolean canWrite(String address)
throws MalformedAddressException,
IOException
MalformedAddressException
IOException
public boolean deleteResource(String address)
throws MalformedAddressException,
IOException
address - address of the resource
MalformedAddressException
IOException
public BufferedInputStream getInputStream(String address)
throws MalformedAddressException,
ResourceNotFoundException,
IOException
address - address of the resource
MalformedAddressException - if the specified address is invalid
ResourceNotFoundException - if the resource did not exist
IOException - if there was an error opening the stream
public BufferedOutputStream getOutputStream(String address)
throws MalformedAddressException,
ResourceNotFoundException,
IOException
address - address of the resource
MalformedAddressException - if the specified address is invalid
ResourceNotFoundException - if the resource did not exist and
cannot be created
IOException - if there was an error opening the stream
public BufferedOutputStream getOutputStream(String address,
boolean append)
throws MalformedAddressException,
ResourceNotFoundException,
IOException
address - address of the resource
MalformedAddressException - if the specified address is invalid
ResourceNotFoundException - if the resource did not exist and
cannot be created
IOException - if there was an error opening the stream.
public boolean storeResource(String address,
BufferedInputStream source,
boolean force)
throws MalformedAddressException,
IOException
address - address of the new resourcesource - a BufferedInputStream from which to read the contentforce - if true then the resource is overwritten if it already exists
MalformedAddressException
IOException
public boolean renameResource(String srcAddress,
String destAddress,
boolean force)
throws ResourceNotFoundException,
MalformedAddressException,
IOException
srcAddress - the current address of the resourcedestAddress - the new address of the resourceforce - if true, the resource at destAddress is overwritten if it
already exists
ResourceNotFoundException
MalformedAddressException
IOException
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||