动态远程文件解析器

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