DynamicRemoteFileResolver
public
class
DynamicRemoteFileResolver
extends Object
| java.lang.Object | |
| ↳ | com.android.tradefed.config.DynamicRemoteFileResolver |
Class that helps resolving path to remote files.
For example: gs://bucket/path/file.txt will be resolved by downloading the file from the GCS bucket.
New protocols should be added to META_INF/services.
Summary
Nested classes | |
|---|---|
interface |
DynamicRemoteFileResolver.FileResolverLoader
Loads implementations of |
Constants | |
|---|---|
String |
OPTIONAL_KEY
|
String |
OPTION_NAME_KEY
|
String |
OPTION_PARALLEL_KEY
|
String |
UNZIP_KEY
|
Public constructors | |
|---|---|
DynamicRemoteFileResolver()
|
|
DynamicRemoteFileResolver(boolean allowParallel)
|
|
DynamicRemoteFileResolver(DynamicRemoteFileResolver.FileResolverLoader loader)
|
|
DynamicRemoteFileResolver(DynamicRemoteFileResolver.FileResolverLoader loader, boolean allowParallel)
|
|
Public methods | |
|---|---|
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)
Download the files matching given filters in a remote zip file. |
void
|
setDevice(ITestDevice device)
Sets the device under tests |
void
|
setOptionMap(Map<String, OptionSetter.OptionFieldsForName> optionMap)
Sets the map of options coming from |
static
final
File
|
unzipIfRequired(File downloadedFile, Map<String, String> query)
Utility that allows to check whether or not a file should be unzip and unzip it if required. |
final
Set<File>
|
validateRemoteFilePath()
Runs through all the |
Constants
OPTIONAL_KEY
public static final String OPTIONAL_KEY
Constant Value: "optional"
OPTION_NAME_KEY
public static final String OPTION_NAME_KEY
Constant Value: "option_name"
OPTION_PARALLEL_KEY
public static final String OPTION_PARALLEL_KEY
Constant Value: "parallel"
UNZIP_KEY
public static final String UNZIP_KEY
Constant Value: "unzip"
Public constructors
DynamicRemoteFileResolver
public DynamicRemoteFileResolver ()
DynamicRemoteFileResolver
public DynamicRemoteFileResolver (boolean allowParallel)
| Parameters | |
|---|---|
allowParallel |
boolean |
DynamicRemoteFileResolver
public DynamicRemoteFileResolver (DynamicRemoteFileResolver.FileResolverLoader loader)
| Parameters | |
|---|---|
loader |
DynamicRemoteFileResolver.FileResolverLoader |
DynamicRemoteFileResolver
public DynamicRemoteFileResolver (DynamicRemoteFileResolver.FileResolverLoader loader, boolean allowParallel)
| Parameters | |
|---|---|
loader |
DynamicRemoteFileResolver.FileResolverLoader |
allowParallel |
boolean |
Public methods
addExtraArgs
public void addExtraArgs (Map<String, String> extraArgs)
Add extra args for the query.
| Parameters | |
|---|---|
extraArgs |
Map |
resolvePartialDownloadZip
public void resolvePartialDownloadZip (File destDir,
String remoteZipFilePath,
List<String> includeFilters,
List<String> excludeFilters)Download the files matching given filters in a remote zip file.
A file inside the remote zip file is only downloaded if its path matches any of the include filters but not the exclude filters.
| Parameters | |
|---|---|
destDir |
File: the file to place the downloaded contents into. |
remoteZipFilePath |
String: the remote path to the zip file to download, relative to an
implementation specific root. |
includeFilters |
List: a list of regex strings to download matching files. A file's path
matching any filter will be downloaded. |
excludeFilters |
List: a list of regex strings to skip downloading matching files. A file's
path matching any filter will not be downloaded. |
| Throws | |
|---|---|
BuildRetrievalError |
if files could not be downloaded. |
setDevice
public void setDevice (ITestDevice device)
Sets the device under tests
| Parameters | |
|---|---|
device |
ITestDevice |
setOptionMap
public void setOptionMap (Map<String, OptionSetter.OptionFieldsForName> optionMap)
Sets the map of options coming from OptionSetter
| Parameters | |
|---|---|
optionMap |
Map |
unzipIfRequired
public static final File unzipIfRequired (File downloadedFile,
Map<String, String> query)Utility that allows to check whether or not a file should be unzip and unzip it if required.
| Parameters | |
|---|---|
downloadedFile |
File |
query |
Map |
| Returns | |
|---|---|
File |
|
| Throws | |
|---|---|
IOException |
|
validateRemoteFilePath
public final Set<File> validateRemoteFilePath ()
Runs through all the File option type and check if their path should be resolved.
| Returns | |
|---|---|
Set<File> |
The list of File that was resolved that way. |
| Throws | |
|---|---|
|
com.android.tradefed.build.BuildRetrievalError |
BuildRetrievalError |
|
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2026-06-22 UTC.