org.apache.commons.vfs2
Interface FilesCache

All Known Implementing Classes:
AbstractFilesCache, DefaultFilesCache, LRUFilesCache, NullFilesCache, SoftRefFilesCache, WeakRefFilesCache

public interface FilesCache

The fileCache interface. Implementations of this interface are expected to be thread safe.

Author:
Commons VFS team

Method Summary
 void clear(FileSystem filesystem)
          purge the entries corresponding to the filesystem.
 void close()
          purge the whole cache.
 FileObject getFile(FileSystem filesystem, FileName name)
          retrieve a file from the cache by its name.
 void putFile(FileObject file)
          add a fileobject to the cache.
 boolean putFileIfAbsent(FileObject file)
          add a fileobject to the cache if it isn't already present.
 void removeFile(FileSystem filesystem, FileName name)
          removes a file from cache.
 

Method Detail

putFile

void putFile(FileObject file)
add a fileobject to the cache.

Parameters:
file - the file

putFileIfAbsent

boolean putFileIfAbsent(FileObject file)
add 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

FileObject getFile(FileSystem filesystem,
                   FileName name)
retrieve a file from the cache by its name.

Parameters:
filesystem - The FileSystem.
name - the name
Returns:
the fileobject or null if file is not cached

clear

void clear(FileSystem filesystem)
purge the entries corresponding to the filesystem.

Parameters:
filesystem - The FileSystem.

close

void close()
purge the whole cache.


removeFile

void removeFile(FileSystem filesystem,
                FileName name)
removes a file from cache.

Parameters:
filesystem - filesystem
name - filename