FileDownloadCacheWrapper

public class FileDownloadCacheWrapper
extends Object implements IFileDownloader

java.lang.Object
com.android.tradefed.build.FileDownloadCacheWrapper


IFileDownloaderインターフェイスを実装しながらFileDownloadCache機能を提供するラッパー クラス。

呼び出し元からキャッシュの使用を抽象化したい場合に役立ちます。

まとめ

パブリック コンストラクター

FileDownloadCacheWrapper (File cacheDir, IFileDownloader delegateDownloader)

公開メソッド

void downloadFile (String remoteFilePath, File destFile)

downloadFile(String)の代替形式で、呼び出し元がリモート コンテンツを配置する宛先ファイルを指定できるようにします。

File downloadFile (String remoteFilePath)

リモート ファイルをローカル ディスク上の一時ファイルにダウンロードします。

void downloadZippedFiles (File destDir, String remoteFilePath, includeFilters, excludeFilters) downloadZippedFiles (File destDir, String remoteFilePath, includeFilters, excludeFilters) downloadZippedFiles (File destDir, String remoteFilePath, includeFilters, excludeFilters)

指定されたフィルターに一致するファイルをリモート zip ファイルにダウンロードします。

boolean isFresh (File localFile, String remoteFilePath)

ローカル ファイルの鮮度を確認します。

パブリック コンストラクター

FileDownloadCacheWrapper

public FileDownloadCacheWrapper (File cacheDir, 
                IFileDownloader delegateDownloader)

パラメーター
cacheDir File

delegateDownloader IFileDownloader

公開メソッド

ダウンロードファイル

public void downloadFile (String remoteFilePath, 
                File destFile)

downloadFile(String)の代替形式で、呼び出し元がリモート コンテンツを配置する宛先ファイルを指定できるようにします。

パラメーター
remoteFilePath String : ダウンロードするファイルへのリモート パス (実装固有のルートを基準とする)。

destFile File : ダウンロードしたコンテンツを配置するファイル。存在すべきではありません。

スロー
BuildRetrievalError

ダウンロードファイル

public File downloadFile (String remoteFilePath)

リモート ファイルをローカル ディスク上の一時ファイルにダウンロードします。

パラメーター
remoteFilePath String : ダウンロードするファイルへのリモート パス (実装固有のルートを基準とする)。

戻り値
File一時的にローカルにダウンロードされたERROR(/File)

スロー
BuildRetrievalError

downloadZippedFiles

public void downloadZippedFiles (File destDir, 
                String remoteFilePath, 
                 includeFilters, 
                 excludeFilters)

指定されたフィルターに一致するファイルをリモート zip ファイルにダウンロードします。

リモート zip ファイル内のファイルは、除外フィルターではなく、包含フィルターのいずれかに一致するパスにのみダウンロードされます。

パラメーター
destDir File : ダウンロードしたコンテンツを配置するファイル。

remoteFilePath String : ダウンロードするファイルへのリモート パス (実装固有のルートを基準とする)。

includeFilters : 一致するファイルをダウンロードするためのフィルターのリスト。

excludeFilters : 一致するファイルのダウンロードをスキップするフィルターのリスト。

スロー
BuildRetrievalError

新鮮です

public boolean isFresh (File localFile, 
                String remoteFilePath)

ローカル ファイルの鮮度を確認します。ローカル ファイルがリモート ファイルと同じ場合、それは最新です。そうでない場合、ローカル ファイルは古くなっています。これは主にキャッシュに使用されます。デフォルトの実装は常に true を返すため、ファイルが不変である場合、鮮度をチェックする必要はありません。

パラメーター
localFile File : ローカル ファイル。

remoteFilePath String : リモート ファイル パス。

戻り値
booleanローカル ファイルが新しい場合は true、それ以外の場合は false。

スロー
BuildRetrievalError