|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface StreamableResource
Interface for a resource that has a stream and properties. The resource is organized in a hierarchy.
This can be a direct match for File.
| Method Summary | |
|---|---|
void |
copy(StreamableResource destination)
Copies this resource to a new one. |
void |
createAsDirectory()
Creates this resource or a physical directory. |
void |
createAsFile()
Creates this resource or a physical file. |
void |
delete()
Physically deletes this resource. |
boolean |
exists()
Checks if this resource physically exists. |
StreamableResource |
getChild(String name)
Gets a specific child of this resource. |
List<? extends StreamableResource> |
getChildren()
Gets the children of the resource. |
String |
getName()
Gets the name, i.e. the last segment of the path. |
StreamableResource |
getParent()
Gets the parent of this resource, i.e. the directory this resource resides in or null if this is the root folder. |
String |
getPath()
Gets the full path of this resource |
Object |
getProperty(String name)
Retrieves a specific property. |
boolean |
isDirectory()
Checks whether this resource is a directory, i.e. whether it can have children. |
boolean |
isFile()
Checks whether this resource is a file, i.e. whether it contains a content stream. |
void |
move(StreamableResource destination)
Moves (or renames) this resource to a new one. |
void |
readLock()
Explicitly sets a read lock on this resource. |
InputStream |
readStream()
Gets the input stream associated to this resource. |
void |
removeProperty(String name)
Removes a specific property. |
void |
setProperty(String name,
Object newValue)
Sets a specific property. |
void |
writeLock()
Explicitly sets a write lock on this resource. |
OutputStream |
writeStream(boolean append)
Gets the output stream associated to this resource. |
| Method Detail |
|---|
String getPath()
String getName()
path.
boolean isDirectory()
true if this resource can have childrenboolean isFile()
true if this resource contains a content stream
List<? extends StreamableResource> getChildren()
throws ResourceException
null
ResourceException - in case anything goes fatally wrong
StreamableResource getParent()
throws ResourceException
null if this is the root folder.
null if there is none
ResourceException - in case anything goes fatally wrong
StreamableResource getChild(String name)
throws ResourceException
name - the name of the child resource
ResourceException - in case anything goes fatally wrong
InputStream readStream()
throws ResourceException
ResourceException - in case anything goes fatally wrong
OutputStream writeStream(boolean append)
throws ResourceException
append - determines whether you append to the existing content
ResourceException - in case anything goes fatally wrong
void delete()
throws ResourceException
ResourceException - in case anything goes fatally wrong or you have not been able
to delete the resource
void move(StreamableResource destination)
throws ResourceException
destination - the new resource
ResourceException - in case anything goes fatally wrong or you have not been able
to move this resource
void copy(StreamableResource destination)
throws ResourceException
destination - the new resource
ResourceException - in case anything goes fatally wrong or you have not been able
to copy this resourceboolean exists()
true if it exists
void createAsDirectory()
throws ResourceException
ResourceException - in case anything goes fatally wrong or you have not been able
to create this resource as a directory
void createAsFile()
throws ResourceException
ResourceException - in case anything goes fatally wrong or you have not been able
to create this resource as a fileObject getProperty(String name)
name - the name of the property
null if there is no
such property
void setProperty(String name,
Object newValue)
throws UnsupportedOperationException
name - the name of the propertynewValue - the new value
UnsupportedOperationException - if this operation is not supported by the specific
implementation
void removeProperty(String name)
throws UnsupportedOperationException
name - the name of the property
UnsupportedOperationException - if this operation is not supported by the specific
implementationvoid readLock()
Not all implementations support his operation as it only makes sense in a
transactional environment. There is no unlock operation as
the release of all locks has to be controlled by the transaction manager.
If unsupported nothing will happen.
void writeLock()
Not all implementations support his operation as it only makes sense in a
transactional environment. There is no unlock operation as
the release of all locks has to be controlled by the transaction manager.
If unsupported nothing will happen.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||