public class SoftRefFilesCache extends AbstractFilesCache
SoftReference| Constructor and Description |
|---|
SoftRefFilesCache()
Constructs a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear(FileSystem fileSystem)
Purges the entries corresponding to the FileSystem.
|
void |
close()
Closes the provider.
|
protected Reference<FileObject> |
createReference(FileObject file,
ReferenceQueue<FileObject> refqueue) |
FileObject |
getFile(FileSystem fileSystem,
FileName fileName)
Retrieves a FileObject from the cache by name.
|
protected Map<FileName,Reference<FileObject>> |
getOrCreateFilesystemCache(FileSystem fileSystem) |
void |
putFile(FileObject fileObject)
Adds a FileObject to the cache.
|
boolean |
putFileIfAbsent(FileObject fileObject)
Adds a FileObject to the cache if it isn't already present.
|
void |
removeFile(FileSystem fileSystem,
FileName fileName)
Removes a file from cache.
|
String |
toString() |
touchFilegetContext, getLogger, init, setContext, setLoggerpublic void clear(FileSystem fileSystem)
FilesCachefileSystem - The FileSystem.public void close()
AbstractVfsComponentclose in interface Closeableclose in interface AutoCloseableclose in interface FilesCacheclose in interface VfsComponentclose in class AbstractVfsComponentprotected Reference<FileObject> createReference(FileObject file, ReferenceQueue<FileObject> refqueue)
public FileObject getFile(FileSystem fileSystem, FileName fileName)
FilesCachefileSystem - The FileSystem.fileName - the nameprotected Map<FileName,Reference<FileObject>> getOrCreateFilesystemCache(FileSystem fileSystem)
public void putFile(FileObject fileObject)
FilesCachefileObject - the filepublic boolean putFileIfAbsent(FileObject fileObject)
FilesCachefileObject - the filepublic void removeFile(FileSystem fileSystem, FileName fileName)
FilesCachefileSystem - file systemfileName - file nameCopyright © 2002–2020 The Apache Software Foundation. All rights reserved.