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() |
touchFile
getContext, getLogger, init, setContext, setLogger
public void clear(FileSystem fileSystem)
FilesCache
fileSystem
- The FileSystem.public void close()
AbstractVfsComponent
close
in interface Closeable
close
in interface AutoCloseable
close
in interface FilesCache
close
in interface VfsComponent
close
in class AbstractVfsComponent
protected Reference<FileObject> createReference(FileObject file, ReferenceQueue<FileObject> refqueue)
public FileObject getFile(FileSystem fileSystem, FileName fileName)
FilesCache
fileSystem
- The FileSystem.fileName
- the nameprotected Map<FileName,Reference<FileObject>> getOrCreateFilesystemCache(FileSystem fileSystem)
public void putFile(FileObject fileObject)
FilesCache
fileObject
- the filepublic boolean putFileIfAbsent(FileObject fileObject)
FilesCache
fileObject
- the filepublic void removeFile(FileSystem fileSystem, FileName fileName)
FilesCache
fileSystem
- file systemfileName
- file nameCopyright © 2002–2020 The Apache Software Foundation. All rights reserved.