org.apache.commons.transaction.file
Class FileResourceManager

java.lang.Object
  extended by org.apache.commons.transaction.file.FileResourceManager
All Implemented Interfaces:
ResourceManager<FileResourceManager.FileResource>

public class FileResourceManager
extends Object
implements ResourceManager<FileResourceManager.FileResource>

Default file system implementation of a resource manager.

Only two properties are supported for reading: "lastModified" and "length" . None are supported for setting or removing.

This implementation is NOT thread-safe. Use TxFileResourceManager if you require a thread-safe implementation.


Nested Class Summary
protected static class FileResourceManager.FileResource
           
 
Field Summary
protected  String rootPath
           
 
Constructor Summary
FileResourceManager(String rootPath)
           
 
Method Summary
 FileResourceManager.FileResource getResource(String path)
          Gets the resource denoted by the path
 String getRootPath()
          Gets the root path of this manager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rootPath

protected String rootPath
Constructor Detail

FileResourceManager

public FileResourceManager(String rootPath)
Method Detail

getResource

public FileResourceManager.FileResource getResource(String path)
                                             throws ResourceException
Description copied from interface: ResourceManager
Gets the resource denoted by the path

Specified by:
getResource in interface ResourceManager<FileResourceManager.FileResource>
Parameters:
path - the path of the resource
Returns:
the resource denoted by the path
Throws:
ResourceException - in case anything goes fatally wrong

getRootPath

public String getRootPath()
Description copied from interface: ResourceManager
Gets the root path of this manager.

Specified by:
getRootPath in interface ResourceManager<FileResourceManager.FileResource>
Returns:
the root path or null if no applicable


Copyright © 2004-2007 The Apache Software Foundation. All Rights Reserved.