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.FileResolverLoaderLoads implementations of  | 
| Fields | |
|---|---|
| 
    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
 | 
| Public constructors | |
|---|---|
| 
      DynamicRemoteFileResolver()
       | |
| 
      DynamicRemoteFileResolver(boolean allowParallel)
       | |
| 
      DynamicRemoteFileResolver(DynamicRemoteFileResolver.FileResolverLoader loader)
       | |
| 
      DynamicRemoteFileResolver(DynamicRemoteFileResolver.FileResolverLoader loader, boolean allowParallel)
       | |
| Public methods | |
|---|---|
| 
        
        
        
        
        
        void | 
      addExtraArgs(Add extra args for the query. | 
| 
        
        
        
        
        
         | 
      getParallelDownloads()
       | 
| 
        
        
        
        
        
        void | 
      resolvePartialDownloadZip(File destDir, String remoteZipFilePath, Download the files matching given filters in a remote zip file. | 
| 
        
        
        
        
        
        void | 
      setDevice(ITestDevice device)
      Sets the device under tests | 
| 
        
        
        
        
        
        void | 
      setOptionMap(Sets the map of options coming from  | 
| 
        
        
        static
        final
        
        File | 
      unzipIfRequired(File downloadedFile, Utility that allows to check whether or not a file should be unzip and unzip it if required. | 
| 
        
        
        
        final
        
         | 
      validateRemoteFilePath()
      Runs through all the  | 
Fields
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
UNZIP_KEY
public static final String UNZIP_KEY
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 (extraArgs) 
Add extra args for the query.
| Parameters | |
|---|---|
| extraArgs |  | 
getParallelDownloads
publicgetParallelDownloads () 
| Returns | |
|---|---|
|  | |
resolvePartialDownloadZip
public void resolvePartialDownloadZip (File destDir, 
                String remoteZipFilePath, 
                 includeFilters, 
                 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 | : a list of regex strings to download matching files. A file's path
     matching any filter will be downloaded. | 
| excludeFilters | : 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 (optionMap) 
Sets the map of options coming from OptionSetter
| Parameters | |
|---|---|
| optionMap |  | 
unzipIfRequired
public static final File unzipIfRequired (File downloadedFile, 
                 query) Utility that allows to check whether or not a file should be unzip and unzip it if required.
| Parameters | |
|---|---|
| downloadedFile | File | 
| query |  | 
| Returns | |
|---|---|
| File | |
validateRemoteFilePath
public finalvalidateRemoteFilePath () 
Runs through all the ERROR(/File) option type and check if their path should be resolved.
| Returns | |
|---|---|
|  | The list of ERROR(/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 2023-10-14 UTC.
