org.apache.commons.vfs2.cache
Class NullFilesCache

java.lang.Object
  extended by org.apache.commons.vfs2.provider.AbstractVfsComponent
      extended by org.apache.commons.vfs2.cache.AbstractFilesCache
          extended by org.apache.commons.vfs2.cache.NullFilesCache
All Implemented Interfaces:
FilesCache, VfsComponent

public class NullFilesCache
extends AbstractFilesCache

A FilesCache 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.

Author:
Commons VFS team

Constructor Summary
NullFilesCache()
           
 
Method Summary
 void clear(FileSystem filesystem)
          purge the entries corresponding to the filesystem.
 void close()
          Closes the provider.
 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.
 void touchFile(FileObject file)
           
 
Methods inherited from class org.apache.commons.vfs2.provider.AbstractVfsComponent
getContext, getLogger, init, setContext, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullFilesCache

public NullFilesCache()
Method Detail

putFile

public void putFile(FileObject file)
Description copied from interface: FilesCache
add a fileobject to the cache.

Parameters:
file - the file

putFileIfAbsent

public boolean putFileIfAbsent(FileObject file)
Description copied from interface: FilesCache
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

public FileObject getFile(FileSystem filesystem,
                          FileName name)
Description copied from interface: FilesCache
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

public void clear(FileSystem filesystem)
Description copied from interface: FilesCache
purge the entries corresponding to the filesystem.

Parameters:
filesystem - The FileSystem.

close

public void close()
Description copied from class: AbstractVfsComponent
Closes the provider. This implementation does nothing.

Specified by:
close in interface FilesCache
Specified by:
close in interface VfsComponent
Overrides:
close in class AbstractVfsComponent

removeFile

public void removeFile(FileSystem filesystem,
                       FileName name)
Description copied from interface: FilesCache
removes a file from cache.

Parameters:
filesystem - filesystem
name - filename

touchFile

public void touchFile(FileObject file)


Copyright © 2002-2012 The Apache Software Foundation. All Rights Reserved.