|
||||||||||
| 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
org.apache.commons.transaction.file.TxFileResourceManager.FileTxContext.TxFileResource
protected class TxFileResourceManager.FileTxContext.TxFileResource
| Constructor Summary | |
|---|---|
TxFileResourceManager.FileTxContext.TxFileResource(File file)
|
|
TxFileResourceManager.FileTxContext.TxFileResource(String path)
|
|
| Method Summary | |
|---|---|
void |
copy(TxFileResourceManager.FileTxContext.TxFileResource destination)
|
protected void |
copyNonRecursive(TxFileResourceManager.FileTxContext.TxFileResource target)
|
protected TxFileResourceManager.FileTxContext.TxFileResource |
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. |
TxFileResourceManager.FileTxContext.TxFileResource |
getChild(String name)
Gets a specific child of this resource. |
List<? extends TxFileResourceManager.FileTxContext.TxFileResource> |
getChildren()
Gets the children of the resource. |
TxFileResourceManager.FileTxContext.TxFileResource |
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. |
protected void |
mkdirs()
|
void |
move(TxFileResourceManager.FileTxContext.TxFileResource destination)
|
protected void |
moveNonRecursive(TxFileResourceManager.FileTxContext.TxFileResource target)
|
protected void |
moveOrcopyRecursive(TxFileResourceManager.FileTxContext.TxFileResource target,
boolean move)
|
void |
readLock()
Explicitly sets a read lock on this resource. |
InputStream |
readStream()
Gets the input stream associated to this resource. |
protected void |
removeNonRecursive()
|
void |
removeProperty(String name)
Removes a specific property. |
protected void |
removeRecursive()
|
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 org.apache.commons.transaction.file.FileResourceManager.FileResource |
|---|
copy, getFile, getFileForResource, getName, move, moveOrCopySaneCheck, prepareMoveorCopy |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TxFileResourceManager.FileTxContext.TxFileResource(File file)
throws ResourceException
ResourceException
public TxFileResourceManager.FileTxContext.TxFileResource(String path)
throws ResourceException
ResourceException| Method Detail |
|---|
public void createAsDirectory()
throws ResourceException
StreamableResource
createAsDirectory in interface StreamableResourcecreateAsDirectory in class FileResourceManager.FileResourceResourceException - 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 StreamableResourcecreateAsFile in class FileResourceManager.FileResourceResourceException - in case anything goes fatally wrong or you have not been able
to create this resource as a file
protected TxFileResourceManager.FileTxContext.TxFileResource create(File file)
throws ResourceException
create in class FileResourceManager.FileResourceResourceException
protected void mkdirs()
throws ResourceException
ResourceException
protected void moveOrcopyRecursive(TxFileResourceManager.FileTxContext.TxFileResource target,
boolean move)
throws ResourceException
ResourceException
protected void removeRecursive()
throws ResourceException
ResourceException
protected void copyNonRecursive(TxFileResourceManager.FileTxContext.TxFileResource target)
throws ResourceException
ResourceException
protected void moveNonRecursive(TxFileResourceManager.FileTxContext.TxFileResource target)
throws ResourceException
ResourceException
protected void removeNonRecursive()
throws ResourceException
ResourceException
public void delete()
throws ResourceException
StreamableResource
delete in interface StreamableResourcedelete in class FileResourceManager.FileResourceResourceException - in case anything goes fatally wrong or you have not been able
to delete the resourcepublic boolean exists()
StreamableResource
exists in interface StreamableResourceexists in class FileResourceManager.FileResourcetrue if it exists
public TxFileResourceManager.FileTxContext.TxFileResource getChild(String name)
throws ResourceException
StreamableResource
getChild in interface StreamableResourcegetChild in class FileResourceManager.FileResourcename - the name of the child resource
ResourceException - in case anything goes fatally wrong
public List<? extends TxFileResourceManager.FileTxContext.TxFileResource> getChildren()
throws ResourceException
StreamableResource
getChildren in interface StreamableResourcegetChildren in class FileResourceManager.FileResourcenull
ResourceException - in case anything goes fatally wrong
public TxFileResourceManager.FileTxContext.TxFileResource getParent()
throws ResourceException
StreamableResourcenull if this is the root folder.
getParent in interface StreamableResourcegetParent in class FileResourceManager.FileResourcenull if there is none
ResourceException - in case anything goes fatally wrongpublic String getPath()
StreamableResource
getPath in interface StreamableResourcegetPath in class FileResourceManager.FileResourcepublic Object getProperty(String name)
StreamableResource
getProperty in interface StreamableResourcegetProperty in class FileResourceManager.FileResourcename - the name of the property
null if there is no
such propertypublic boolean isDirectory()
StreamableResource
isDirectory in interface StreamableResourceisDirectory in class FileResourceManager.FileResourcetrue if this resource can have childrenpublic boolean isFile()
StreamableResource
isFile in interface StreamableResourceisFile in class FileResourceManager.FileResourcetrue if this resource contains a content stream
public void copy(TxFileResourceManager.FileTxContext.TxFileResource destination)
throws ResourceException
ResourceException
public void move(TxFileResourceManager.FileTxContext.TxFileResource destination)
throws ResourceException
ResourceException
public InputStream readStream()
throws ResourceException
StreamableResource
readStream in interface StreamableResourcereadStream in class FileResourceManager.FileResourceResourceException - in case anything goes fatally wrong
public OutputStream writeStream(boolean append)
throws ResourceException
StreamableResource
writeStream in interface StreamableResourcewriteStream in class FileResourceManager.FileResourceappend - determines whether you append to the existing content
ResourceException - in case anything goes fatally wrongpublic void removeProperty(String name)
StreamableResource
removeProperty in interface StreamableResourceremoveProperty in class FileResourceManager.FileResourcename - the name of the property
public void setProperty(String name,
Object newValue)
StreamableResource
setProperty in interface StreamableResourcesetProperty in class FileResourceManager.FileResourcename - the name of the propertynewValue - the new valuepublic 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 StreamableResourcereadLock in class FileResourceManager.FileResourcepublic 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 StreamableResourcewriteLock in class FileResourceManager.FileResource
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||