public class Cache extends Object
HashMap based in-memory cache for storing LicenseDownloader.LicenseDownloadResults.| Constructor and Description |
|---|
Cache(boolean enforcingUniqueSha1s) |
| Modifier and Type | Method and Description |
|---|---|
LicenseDownloader.LicenseDownloadResult |
get(String url) |
void |
put(String url,
LicenseDownloader.LicenseDownloadResult entry)
Binds the given
url to the give LicenseDownloader.LicenseDownloadResult. |
public LicenseDownloader.LicenseDownloadResult get(String url)
url - the cache key to seekLicenseDownloader.LicenseDownloadResult bound to the given url or null if no entry is bound to
the given urlpublic void put(String url, LicenseDownloader.LicenseDownloadResult entry)
url to the give LicenseDownloader.LicenseDownloadResult. If both enforcingUniqueSha1s and
LicenseDownloader.LicenseDownloadResult.isSuccess() are true and an entry with the given
LicenseDownloader.LicenseDownloadResult.getSha1() already exists in sha1ToFile, asserts that both the added and
the available entry point at the same file.url - the URL the given entry comes fromentry - the result of downloading from urlCopyright © 2010–2019 MojoHaus. All rights reserved.