public class SoftRefFilesCache extends AbstractFilesCache
SoftReference
Constructor and Description |
---|
SoftRefFilesCache() |
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.
|
touchFile
getContext, getLogger, init, setContext, setLogger
public void putFile(FileObject fileObject)
FilesCache
fileObject
- the filepublic boolean putFileIfAbsent(FileObject fileObject)
FilesCache
fileObject
- the fileprotected Reference<FileObject> createReference(FileObject file, ReferenceQueue<FileObject> refqueue)
public FileObject getFile(FileSystem fileSystem, FileName fileName)
FilesCache
fileSystem
- The FileSystem.fileName
- the namepublic 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
public void removeFile(FileSystem fileSystem, FileName fileName)
FilesCache
fileSystem
- file systemfileName
- file nameprotected Map<FileName,Reference<FileObject>> getOrCreateFilesystemCache(FileSystem fileSystem)
Copyright © 2002–2020 The Apache Software Foundation. All rights reserved.