Package org.apache.commons.vfs.cache
Class DefaultFilesCache
java.lang.Object
org.apache.commons.vfs.provider.AbstractVfsComponent
org.apache.commons.vfs.cache.AbstractFilesCache
org.apache.commons.vfs.cache.DefaultFilesCache
- All Implemented Interfaces:
FilesCache
,VfsComponent
A
This implementation caches every file for the complete lifetime of the used
FilesCache
implementation.This implementation caches every file for the complete lifetime of the used
FileSystemManager
.- Version:
- $Revision: 480428 $ $Date: 2006-11-29 07:15:24 +0100 (Wed, 29 Nov 2006) $
- Author:
- Mario Ivankovits
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear
(FileSystem filesystem) purge the entries corresponding to the filesystemvoid
close()
Closes the provider.getFile
(FileSystem filesystem, FileName name) retrieve a file from the cache by its nameprotected Map
getOrCreateFilesystemCache
(FileSystem filesystem) void
putFile
(FileObject file) add a fileobject to the cachevoid
removeFile
(FileSystem filesystem, FileName name) removes a file from cachevoid
touchFile
(FileObject file) Methods inherited from class org.apache.commons.vfs.provider.AbstractVfsComponent
getContext, getLogger, init, setContext, setLogger
-
Constructor Details
-
DefaultFilesCache
public DefaultFilesCache()
-
-
Method Details
-
putFile
Description copied from interface:FilesCache
add a fileobject to the cache- Parameters:
file
- the file
-
getFile
Description copied from interface:FilesCache
retrieve a file from the cache by its name- Parameters:
name
- the name- Returns:
- the fileobject or null if file is not cached
-
clear
Description copied from interface:FilesCache
purge the entries corresponding to the filesystem -
getOrCreateFilesystemCache
-
close
public void close()Description copied from class:AbstractVfsComponent
Closes the provider. This implementation does nothing.- Specified by:
close
in interfaceFilesCache
- Specified by:
close
in interfaceVfsComponent
- Overrides:
close
in classAbstractVfsComponent
-
removeFile
Description copied from interface:FilesCache
removes a file from cache- Parameters:
filesystem
- filesystemname
- filename
-
touchFile
-