動態遠端文件解析器

public class DynamicRemoteFileResolver
extends Object

java.lang.Object
com.android.tradefed.config.DynamicRemoteFileResolver


幫助解析遠端檔案路徑的類別。

例如:gs://bucket/path/file.txt 將透過從GCS儲存桶下載檔案來解析。

新協定應新增至 META_INF/services 中。

概括

嵌套類

interface DynamicRemoteFileResolver.FileResolverLoader

載入IRemoteFileResolver的實作。

領域

public static final String OPTIONAL_KEY

public static final String OPTION_NAME_KEY

public static final String OPTION_PARALLEL_KEY

public static final String UNZIP_KEY

公共構造函數

DynamicRemoteFileResolver ()
DynamicRemoteFileResolver (boolean allowParallel)
DynamicRemoteFileResolver ( DynamicRemoteFileResolver.FileResolverLoader loader)
DynamicRemoteFileResolver ( DynamicRemoteFileResolver.FileResolverLoader loader, boolean allowParallel)

公共方法

void addExtraArgs ( extraArgs) addExtraArgs ( extraArgs)

為查詢新增額外的參數。

getParallelDownloads ()
void resolvePartialDownloadZip (File destDir, String remoteZipFilePath, includeFilters, excludeFilters) resolvePartialDownloadZip (File destDir, String remoteZipFilePath, includeFilters, excludeFilters) resolvePartialDownloadZip (File destDir, String remoteZipFilePath, includeFilters, excludeFilters)

下載遠端 zip 檔案中與給定過濾器相符的檔案。

void setDevice ( ITestDevice device)

設定被測設備

void setOptionMap ( optionMap) setOptionMap ( optionMap)

設定來自OptionSetter的選項映射

static final File unzipIfRequired (File downloadedFile, query) unzipIfRequired (File downloadedFile, query)

允許檢查檔案是否應該解壓縮並在需要時解壓縮的實用程式。

final validateRemoteFilePath ()

執行所有ERROR(/File)選項類型並檢查是否應解析其路徑。

領域

OPTIONAL_KEY

public static final String OPTIONAL_KEY

OPTION_NAME_KEY

public static final String OPTION_NAME_KEY

OPTION_PARALLEL_KEY

public static final String OPTION_PARALLEL_KEY

解壓縮鍵

public static final String UNZIP_KEY

公共構造函數

動態遠端文件解析器

public DynamicRemoteFileResolver ()

動態遠端文件解析器

public DynamicRemoteFileResolver (boolean allowParallel)

參數
allowParallel boolean

動態遠端文件解析器

public DynamicRemoteFileResolver (DynamicRemoteFileResolver.FileResolverLoader loader)

參數
loader DynamicRemoteFileResolver.FileResolverLoader

動態遠端文件解析器

public DynamicRemoteFileResolver (DynamicRemoteFileResolver.FileResolverLoader loader, 
                boolean allowParallel)

參數
loader DynamicRemoteFileResolver.FileResolverLoader

allowParallel boolean

公共方法

新增額外參數

public void addExtraArgs ( extraArgs)

為查詢新增額外的參數。

參數
extraArgs

取得並行下載

public  getParallelDownloads ()

退貨

解決部分下載Zip

public void resolvePartialDownloadZip (File destDir, 
                String remoteZipFilePath, 
                 includeFilters, 
                 excludeFilters)

下載遠端 zip 檔案中與給定過濾器相符的檔案。

只有當遠端 zip 檔案內的檔案路徑與任何包含過濾器相符但不與排除過濾器相符時,才會下載該檔案。

參數
destDir File :放置下載內容的檔案。

remoteZipFilePath String :要下載的 zip 檔案的遠端路徑,相對於特定實作的根目錄。

includeFilters :用於下載符合檔案的正規表示式字串清單。將下載與任何過濾器相符的檔案路徑。

excludeFilters :用於跳過下載符合檔案的正規表示式字串清單。與任何過濾器匹配的檔案路徑將不會被下載。

投擲
BuildRetrievalError如果無法下載檔案。

設定設備

public void setDevice (ITestDevice device)

設定被測設備

參數
device ITestDevice

設定選項映射

public void setOptionMap ( optionMap)

設定來自OptionSetter的選項映射

參數
optionMap

如果需要解壓縮

public static final File unzipIfRequired (File downloadedFile, 
                 query)

允許檢查檔案是否應該解壓縮並在需要時解壓縮的實用程式。

參數
downloadedFile File

query

退貨
File

驗證遠端檔案路徑

public final  validateRemoteFilePath ()

執行所有ERROR(/File)選項類型並檢查是否應解析其路徑。

退貨
以這種方式解決的ERROR(/File)列表。

投擲
com.android.tradefed.build.BuildRetrievalError
BuildRetrievalError