|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.commons.transaction.file.FileResourceManager.FileResource
protected static class FileResourceManager.FileResource
| Constructor Summary | |
|---|---|
FileResourceManager.FileResource(File file)
|
|
FileResourceManager.FileResource(String path)
|
|
| Method Summary | |
|---|---|
void |
copy(StreamableResource destination)
Copies this resource to a new one. |
protected FileResourceManager.FileResource |
create(File file)
|
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. |
FileResourceManager.FileResource |
getChild(String name)
Gets a specific child of this resource. |
List<? extends FileResourceManager.FileResource> |
getChildren()
Gets the children of the resource. |
protected File |
getFile()
|
protected static File |
getFileForResource(StreamableResource resource)
|
String |
getName()
Gets the name, i.e. the last segment of the path. |
FileResourceManager.FileResource |
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. |
protected void |
moveOrCopySaneCheck(StreamableResource destination)
|
protected boolean |
prepareMoveorCopy(StreamableResource destination)
|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileResourceManager.FileResource(String path)
throws ResourceException
ResourceException
public FileResourceManager.FileResource(File file)
throws ResourceException
ResourceException| Method Detail |
|---|
protected static File getFileForResource(StreamableResource resource)
throws ResourceException
ResourceException
public void createAsDirectory()
throws ResourceException
StreamableResource
createAsDirectory in interface StreamableResourceResourceException - in case anything goes fatally wrong or you have not been able
to create this resource as a directory
public void createAsFile()
throws ResourceException
StreamableResource
createAsFile in interface StreamableResourceResourceException - in case anything goes fatally wrong or you have not been able
to create this resource as a file
public void delete()
throws ResourceException
StreamableResource
delete in interface StreamableResourceResourceException - in case anything goes fatally wrong or you have not been able
to delete the resourcepublic boolean exists()
StreamableResource
exists in interface StreamableResourcetrue if it exists
public List<? extends FileResourceManager.FileResource> getChildren()
throws ResourceException
StreamableResource
getChildren in interface StreamableResourcenull
ResourceException - in case anything goes fatally wrong
public FileResourceManager.FileResource getParent()
throws ResourceException
StreamableResourcenull if this is the root folder.
getParent in interface StreamableResourcenull if there is none
ResourceException - in case anything goes fatally wrongpublic String getPath()
StreamableResource
getPath in interface StreamableResourcepublic boolean isDirectory()
StreamableResource
isDirectory in interface StreamableResourcetrue if this resource can have childrenpublic boolean isFile()
StreamableResource
isFile in interface StreamableResourcetrue if this resource contains a content stream
public void move(StreamableResource destination)
throws ResourceException
StreamableResource
move in interface StreamableResourcedestination - the new resource
ResourceException - in case anything goes fatally wrong or you have not been able
to move this resource
public void copy(StreamableResource destination)
throws ResourceException
StreamableResource
copy in interface StreamableResourcedestination - the new resource
ResourceException - in case anything goes fatally wrong or you have not been able
to copy this resource
protected boolean prepareMoveorCopy(StreamableResource destination)
throws ResourceException
ResourceException
protected void moveOrCopySaneCheck(StreamableResource destination)
throws ResourceException
ResourceException
public InputStream readStream()
throws ResourceException
StreamableResource
readStream in interface StreamableResourceResourceException - in case anything goes fatally wrong
public OutputStream writeStream(boolean append)
throws ResourceException
StreamableResource
writeStream in interface StreamableResourceappend - determines whether you append to the existing content
ResourceException - in case anything goes fatally wrongpublic void removeProperty(String name)
StreamableResource
removeProperty in interface StreamableResourcename - the name of the property
public void setProperty(String name,
Object newValue)
StreamableResource
setProperty in interface StreamableResourcename - the name of the propertynewValue - the new valuepublic Object getProperty(String name)
StreamableResource
getProperty in interface StreamableResourcename - the name of the property
null if there is no
such propertypublic void readLock()
StreamableResource
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.
readLock in interface StreamableResourcepublic void writeLock()
StreamableResource
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.
writeLock in interface StreamableResourceprotected File getFile()
protected FileResourceManager.FileResource create(File file)
throws ResourceException
ResourceException
public FileResourceManager.FileResource getChild(String name)
throws ResourceException
StreamableResource
getChild in interface StreamableResourcename - the name of the child resource
ResourceException - in case anything goes fatally wrongpublic String getName()
StreamableResourcepath.
getName in interface StreamableResource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||