| java.lang.Object org.openharmonise.vfs.VirtualFileCache
VirtualFileCache | public class VirtualFileCache (Code) | | Generic cache for VirtualFileObjects. The default timeout for these objects
is 5 minutes, this can be overridden.
author: Matthew Large version: $Revision: 1.1 $ |
Constructor Summary | |
public | VirtualFileCache(int nTimeout) Constructs a VirtualFileCache with a specific timeout, overriding the default
5 minute timeout.
Parameters: nTimeout - Sets the cache's timeout value in milliseconds. | public | VirtualFileCache() |
Method Summary | |
public synchronized void | addFile(VirtualFile vfFile) Adds a VirtualFile to the cache, if a VirtualFile with the path is already in the cache it will be overwritten with this one. | public VirtualFile | getFile(String sFullpath) Gets a VirtualFile from the cache as specified by the path. | public List | getPaths() Gets a List object containing all the path Strings in the cache. | public synchronized boolean | hasFile(String sFullpath) Checks if the cache contains a specific VirtualFile as indexed by path.
Parameters: sFullpath - The full path of the VirtualFile to be checked true if the cache contains the VirtualFile. | public VirtualFile | removeFile(String sFullpath) Removes a specific VirtualFile from the cache. |
VirtualFileCache | public VirtualFileCache(int nTimeout)(Code) | | Constructs a VirtualFileCache with a specific timeout, overriding the default
5 minute timeout.
Parameters: nTimeout - Sets the cache's timeout value in milliseconds. (60000=1 minute) |
VirtualFileCache | public VirtualFileCache()(Code) | | |
addFile | public synchronized void addFile(VirtualFile vfFile)(Code) | | Adds a VirtualFile to the cache, if a VirtualFile with the path is already in the cache it will be overwritten with this one.
Parameters: vfFile - VirtualFile to be added |
getFile | public VirtualFile getFile(String sFullpath)(Code) | | Gets a VirtualFile from the cache as specified by the path.
Parameters: sFullpath - Path of the VirtualFile to be returned Requested VirtualFile or null if path is not found in cache |
getPaths | public List getPaths()(Code) | | Gets a List object containing all the path Strings in the cache.
List of path Strings |
hasFile | public synchronized boolean hasFile(String sFullpath)(Code) | | Checks if the cache contains a specific VirtualFile as indexed by path.
Parameters: sFullpath - The full path of the VirtualFile to be checked true if the cache contains the VirtualFile. If the VirtualFile has timed out it will be removed from the cache and False will be returned |
removeFile | public VirtualFile removeFile(String sFullpath)(Code) | | Removes a specific VirtualFile from the cache.
Parameters: sFullpath - Path of VirtualFile to be removed previous value associated with specified key, or null if there was no mapping for key |
|
|