Package org.apache.commons.vfs2.cache
Class NullFilesCache
- java.lang.Object
-
- org.apache.commons.vfs2.provider.AbstractVfsComponent
-
- org.apache.commons.vfs2.cache.AbstractFilesCache
-
- org.apache.commons.vfs2.cache.NullFilesCache
-
- All Implemented Interfaces:
FilesCache
,VfsComponent
public class NullFilesCache extends AbstractFilesCache
AFilesCache
implementation.This implementation never ever caches a single file.
Notice: if you use resolveFile(uri) multiple times with the same path, the system will always create a new instance. Changes on one instance of this file are not seen by the others.
-
-
Constructor Summary
Constructors Constructor Description NullFilesCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear(FileSystem filesystem)
Purges the entries corresponding to the FileSystem.FileObject
getFile(FileSystem filesystem, FileName name)
Retrieves a FileObject from the cache by name.void
putFile(FileObject file)
Adds a FileObject to the cache.boolean
putFileIfAbsent(FileObject file)
Adds a FileObject to the cache if it isn't already present.void
removeFile(FileSystem filesystem, FileName name)
Removes a file from cache.-
Methods inherited from class org.apache.commons.vfs2.cache.AbstractFilesCache
touchFile
-
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
close, getContext, getLogger, init, setContext, setLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.commons.vfs2.FilesCache
close
-
-
-
-
Constructor Detail
-
NullFilesCache
public NullFilesCache()
-
-
Method Detail
-
putFile
public void putFile(FileObject file)
Description copied from interface:FilesCache
Adds a FileObject to the cache.- Parameters:
file
- the file
-
putFileIfAbsent
public boolean putFileIfAbsent(FileObject file)
Description copied from interface:FilesCache
Adds a FileObject to the cache if it isn't already present.- Parameters:
file
- the file- Returns:
- true if the file was stored, false otherwise.
-
getFile
public FileObject getFile(FileSystem filesystem, FileName name)
Description copied from interface:FilesCache
Retrieves a FileObject from the cache by name.- Parameters:
filesystem
- The FileSystem.name
- the name- Returns:
- the file object or null if file is not cached
-
clear
public void clear(FileSystem filesystem)
Description copied from interface:FilesCache
Purges the entries corresponding to the FileSystem.- Parameters:
filesystem
- The FileSystem.
-
removeFile
public void removeFile(FileSystem filesystem, FileName name)
Description copied from interface:FilesCache
Removes a file from cache.- Parameters:
filesystem
- filesystemname
- filename
-
-