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> referenceQueue)
Constructs a new Reference.
|
FileObject |
getFile(FileSystem fileSystem,
FileName fileName)
Retrieves a FileObject from the cache by name.
|
protected Map<FileName,Reference<FileObject>> |
getOrCreateFilesystemCache(FileSystem fileSystem)
Gets or creates a new Map.
|
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> referenceQueue)
file - a file object.referenceQueue - a ReferenceQueue.public FileObject getFile(FileSystem fileSystem, FileName fileName)
FilesCachefileSystem - The FileSystem.fileName - the nameprotected Map<FileName,Reference<FileObject>> getOrCreateFilesystemCache(FileSystem fileSystem)
fileSystem - the key.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–2025 The Apache Software Foundation. All rights reserved.