動態遠程文件解析器

public class DynamicRemoteFileResolver
extends Object

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


幫助解析遠程文件路徑的類。

例如:gs://bucket/path/file.txt 會通過從GCS bucket下載文件來解析。

應將新協議添加到 META_INF/services。

概括

嵌套類

interface DynamicRemoteFileResolver.FileResolverLoader

加載IRemoteFileResolver的實現。

領域

public static final String OPTIONAL_KEY

public static final String UNZIP_KEY

公共構造函數

DynamicRemoteFileResolver ()
DynamicRemoteFileResolver ( DynamicRemoteFileResolver.FileResolverLoader loader)

公共方法

void addExtraArgs ( extraArgs) addExtraArgs ( extraArgs)

為查詢添加額外的參數。

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

UNZIP_KEY

public static final String UNZIP_KEY

公共構造函數

動態遠程文件解析器

public DynamicRemoteFileResolver ()

動態遠程文件解析器

public DynamicRemoteFileResolver (DynamicRemoteFileResolver.FileResolverLoader loader)

參數
loader DynamicRemoteFileResolver.FileResolverLoader

公共方法

添加額外參數

public void addExtraArgs ( extraArgs)

為查詢添加額外的參數。

參數
extraArgs

resolvePartialDownloadZip

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

unzipIfRequired

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