public class Cache
extends java.lang.Object
implements java.io.Closeable
| Modifier and Type | Method and Description |
|---|---|
void |
addCachedLayersToMetadata(java.util.List<CachedLayer> cachedLayers)
Adds the cached layer to the cache metadata.
|
void |
addCachedLayersWithMetadataToMetadata(java.util.List<CachedLayerWithMetadata> cachedLayersWithMetadata)
Adds the cached layer to the cache metadata.
|
void |
close()
Finishes the use of the cache by flushing any unsaved changes.
|
static Cache |
init(java.nio.file.Path cacheDirectory)
Initializes a cache with a directory.
|
public static Cache init(java.nio.file.Path cacheDirectory) throws java.nio.file.NotDirectoryException, CacheMetadataCorruptedException
cacheDirectory - the directory to use for the cache.java.nio.file.NotDirectoryException - if cacheDirectory is not a directory.CacheMetadataCorruptedException - if loading the cache metadata fails.public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOException - if saving the cache metadata fails.public void addCachedLayersToMetadata(java.util.List<CachedLayer> cachedLayers)
cachedLayers - the layers to addpublic void addCachedLayersWithMetadataToMetadata(java.util.List<CachedLayerWithMetadata> cachedLayersWithMetadata)
cachedLayersWithMetadata - the layers to add