public class CacheReader extends Object
| Constructor and Description |
|---|
CacheReader(Cache cache) |
| Modifier and Type | Method and Description |
|---|---|
CachedLayer |
getLayer(DescriptorDigest layerDigest) |
Path |
getLayerFile(List<Path> sourceFiles)
Finds the file that stores the content BLOB for an application layer.
|
CachedLayer |
getUpToDateLayerBySourceFiles(List<Path> sourceFiles)
Gets an up-to-date layer that is built from the
sourceFiles. |
public CacheReader(Cache cache)
@Nullable public CachedLayer getLayer(DescriptorDigest layerDigest) throws LayerPropertyNotFoundException
layerDigest, or null if not foundLayerPropertyNotFoundException@Nullable public Path getLayerFile(List<Path> sourceFiles) throws CacheMetadataCorruptedException
sourceFiles - the source files the layer must be built fromlayerType and sourceFiles, or null if there is no matchCacheMetadataCorruptedException@Nullable public CachedLayer getUpToDateLayerBySourceFiles(List<Path> sourceFiles) throws IOException, CacheMetadataCorruptedException
sourceFiles.
The method returns the first up-to-date layer found. This is safe because the source files will not have been modified since creation of any up-to-date layer (ie. all up-to-date layers should have the same file contents)
Copyright © 2018. All rights reserved.