DynamicRemoteFileResolver
public
class
DynamicRemoteFileResolver
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.config.DynamicRemoteFileResolver |
這個類別有助於解析遠端檔案的路徑。
舉例來說,系統會從 GCS 值區下載檔案,以解析 gs://bucket/path/file.txt。
新通訊協定應新增至 META_INF/services。
摘要
巢狀類別 | |
|---|---|
interface |
DynamicRemoteFileResolver.FileResolverLoader
載入 |
常數 | |
|---|---|
String |
OPTIONAL_KEY
|
String |
OPTION_NAME_KEY
|
String |
OPTION_PARALLEL_KEY
|
String |
UNZIP_KEY
|
公用建構函式 | |
|---|---|
DynamicRemoteFileResolver()
|
|
DynamicRemoteFileResolver(boolean allowParallel)
|
|
DynamicRemoteFileResolver(DynamicRemoteFileResolver.FileResolverLoader loader)
|
|
DynamicRemoteFileResolver(DynamicRemoteFileResolver.FileResolverLoader loader, boolean allowParallel)
|
|
公用方法 | |
|---|---|
void
|
addExtraArgs(Map<String, String> extraArgs)
Add extra args for the query. |
List<ExtendedFile>
|
getParallelDownloads()
|
void
|
resolvePartialDownloadZip(File destDir, String remoteZipFilePath, List<String> includeFilters, List<String> excludeFilters)
以遠端 ZIP 檔案的形式,下載符合指定篩選條件的檔案。 |
void
|
setDevice(ITestDevice device)
設定測試裝置 |
void
|
setOptionMap(Map<String, OptionSetter.OptionFieldsForName> optionMap)
設定來自 |
static
final
File
|
unzipIfRequired(File downloadedFile, Map<String, String> query)
這項公用程式可檢查檔案是否需要解壓縮,並在必要時解壓縮。 |
final
Set<File>
|
validateRemoteFilePath()
逐一執行所有 |
常數
OPTIONAL_KEY
public static final String OPTIONAL_KEY
常數值: "optional"
OPTION_NAME_KEY
public static final String OPTION_NAME_KEY
常數值: "option_name"
OPTION_PARALLEL_KEY
public static final String OPTION_PARALLEL_KEY
常數值: "parallel"
UNZIP_KEY
public static final String UNZIP_KEY
常數值: "unzip"
公用建構函式
DynamicRemoteFileResolver
public DynamicRemoteFileResolver ()
DynamicRemoteFileResolver
public DynamicRemoteFileResolver (boolean allowParallel)
| 參數 | |
|---|---|
allowParallel |
boolean |
DynamicRemoteFileResolver
public DynamicRemoteFileResolver (DynamicRemoteFileResolver.FileResolverLoader loader)
| 參數 | |
|---|---|
loader |
DynamicRemoteFileResolver.FileResolverLoader |
DynamicRemoteFileResolver
public DynamicRemoteFileResolver (DynamicRemoteFileResolver.FileResolverLoader loader, boolean allowParallel)
| 參數 | |
|---|---|
loader |
DynamicRemoteFileResolver.FileResolverLoader |
allowParallel |
boolean |
公用方法
addExtraArgs
public void addExtraArgs (Map<String, String> extraArgs)
為查詢新增額外引數。
| 參數 | |
|---|---|
extraArgs |
Map |
resolvePartialDownloadZip
public void resolvePartialDownloadZip (File destDir,
String remoteZipFilePath,
List<String> includeFilters,
List<String> excludeFilters)以遠端 ZIP 檔案的形式,下載符合指定篩選條件的檔案。
只有在路徑符合任何納入篩選器,但不符合排除篩選器時,系統才會下載遠端 ZIP 檔案中的檔案。
| 參數 | |
|---|---|
destDir |
File:要將下載內容放入的檔案。 |
remoteZipFilePath |
String:要下載的 ZIP 檔案遠端路徑,與實作專屬根目錄相對。 |
includeFilters |
List:下載相符檔案的 regex 字串清單。系統會下載符合任何篩選條件的檔案路徑。 |
excludeFilters |
List:要略過下載相符檔案的 regex 字串清單。如果檔案路徑符合任何篩選條件,系統就不會下載該檔案。 |
| 擲回 | |
|---|---|
BuildRetrievalError |
如果無法下載檔案。 |
setOptionMap
public void setOptionMap (Map<String, OptionSetter.OptionFieldsForName> optionMap)
設定來自 OptionSetter 的選項對應
| 參數 | |
|---|---|
optionMap |
Map |
unzipIfRequired
public static final File unzipIfRequired (File downloadedFile,
Map<String, String> query)這項公用程式可檢查檔案是否應解壓縮,並視需要解壓縮檔案。
| 參數 | |
|---|---|
downloadedFile |
File |
query |
Map |
| 傳回 | |
|---|---|
File |
|
| 擲回 | |
|---|---|
IOException |
|
validateRemoteFilePath
public final Set<File> validateRemoteFilePath ()
執行所有 File 選項型別,並檢查是否應解析路徑。
| 傳回 | |
|---|---|
Set<File> |
以這種方式解決的 File 清單。 |
| 擲回 | |
|---|---|
|
com.android.tradefed.build.BuildRetrievalError |
BuildRetrievalError |
|