public class

FileDownloadCache

extends Object
java.lang.Object
   ↳ com.android.tradefed.build.FileDownloadCache

Class Overview

A helper class that maintains a local filesystem LRU cache of downloaded files.

Summary

Public Methods
File fetchRemoteFile(IFileDownloader downloader, String remotePath)
Returns a local file corresponding to the given remotePath

The local File will be copied from the cache if it exists, otherwise will be downloaded via the given IFileDownloader.

void setMaxCacheSize(long numBytes)
Set the maximum size of the local file cache.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public File fetchRemoteFile (IFileDownloader downloader, String remotePath)

Returns a local file corresponding to the given remotePath

The local File will be copied from the cache if it exists, otherwise will be downloaded via the given IFileDownloader.

Parameters
downloader the IFileDownloader
remotePath the remote file.
Returns
  • a local File containing contents of remotePath
Throws
BuildRetrievalError if file could not be retrieved

public void setMaxCacheSize (long numBytes)

Set the maximum size of the local file cache.

Cache will not be adjusted immediately if set to a smaller size than current, but will take effect on next file download.