public class Cache extends Object implements Closeable
Modifier and Type | Method and Description |
---|---|
void |
addCachedLayersToMetadata(List<CachedLayer> cachedLayers)
Adds the cached layer to the cache metadata.
|
void |
addCachedLayersWithMetadataToMetadata(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(Path cacheDirectory)
Initializes a cache with a directory.
|
public static Cache init(Path cacheDirectory) throws NotDirectoryException, CacheMetadataCorruptedException
cacheDirectory
- the directory to use for the cache.NotDirectoryException
- if cacheDirectory
is not a directory.CacheMetadataCorruptedException
- if loading the cache metadata fails.public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
- if saving the cache metadata fails.public void addCachedLayersToMetadata(List<CachedLayer> cachedLayers)
cachedLayers
- the layers to addpublic void addCachedLayersWithMetadataToMetadata(List<CachedLayerWithMetadata> cachedLayersWithMetadata)
cachedLayersWithMetadata
- the layers to addCopyright © 2018. All rights reserved.