public class ExtensionDocCache extends Object
| Constructor and Description |
|---|
ExtensionDocCache(Path cachePath)
Constructs a ExtensionDocCache instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(String extension,
String description,
String lastModifiedDateTime)
The add method adds an extension with description and last modified date to the cache.
|
boolean |
commit()
The commit method writes the data to the given location in the
local storage.
|
Map<String,String> |
getExtensionDescriptionMap()
The getExtensionDescriptionMap method returns a map of extensions
with extension name as key and extension description as value.
|
String |
getLastModifiedDateTime(String extension)
The getLastModifiedDateTime returns the last modified date
a given extension.
|
boolean |
has(String extension)
Return whether extension exists in the cache.
|
boolean |
isInMemory() |
void |
remove(String extension)
Remove an extension from the cache.
|
void |
removeComplementOf(Set<String> extensions)
Remove relative complement of the given extension set
from the extension set in the cache.
|
public ExtensionDocCache(Path cachePath)
cachePath - the path to the cachepublic boolean has(String extension)
extension - the name of the cachepublic void add(String extension, String description, String lastModifiedDateTime)
extension - the name of the extensiondescription - the description for the extensionlastModifiedDateTime - the last modified date of the extension docpublic String getLastModifiedDateTime(String extension)
extension - the name of the extensionpublic void remove(String extension)
extension - the name of the extensionpublic void removeComplementOf(Set<String> extensions)
extensions - the extension setpublic boolean isInMemory()
public boolean commit()
cache
it will return the false.
3). Due to any IO error if writing fails it will return the false.
Overall method only returns true if it has written to the local storage.public Map<String,String> getExtensionDescriptionMap()
Copyright © 2019. All rights reserved.