PartialZipDownloadCache

public class PartialZipDownloadCache
extends Object

java.lang.Object
   ↳ com.android.tradefed.build.cache.PartialZipDownloadCache


Utility to cache partial download files based on their content. This is based of the zip content so it includes crc for free from the metadata.

Summary

Protected constructors

PartialZipDownloadCache()

Public methods

boolean getCachedFile(File targetFile, String fileName, String crc)

Finds a file in the cache matching the path and crc

static PartialZipDownloadCache getDefaultCache()
void populateCacheFile(File toCache, String fileName, String crc)

Populate the file in the cache

Protected methods

void cleanUpCache()

Protected constructors

PartialZipDownloadCache

protected PartialZipDownloadCache ()

Public methods

getCachedFile

public boolean getCachedFile (File targetFile, 
                String fileName, 
                String crc)

Finds a file in the cache matching the path and crc

Parameters
targetFile File: location where to return the file

fileName String: Path of file

crc String: checksum of file in zip

Returns
boolean True if cache file exists, false otherwise

getDefaultCache

public static PartialZipDownloadCache getDefaultCache ()

Returns
PartialZipDownloadCache

populateCacheFile

public void populateCacheFile (File toCache, 
                String fileName, 
                String crc)

Populate the file in the cache

Parameters
toCache File: File to put in cache

fileName String: the path of the file

crc String: The crc checksum of file in zip

Protected methods

cleanUpCache

protected void cleanUpCache ()