IRemoteFileResolver

public interface IRemoteFileResolver

com.android.tradefed.config.remote.IRemoteFileResolver


Interface for objects that can resolve a remote file into a local one. For example: gs://bucket/dir/file.txt would be downloaded and changed to a local path.

Summary

Nested classes

class IRemoteFileResolver.RemoteFileResolverArgs

The args passed to the resolvers 

class IRemoteFileResolver.ResolvedFile

Class holding information about the resolved file and some metadata. 

Public methods

abstract String getSupportedProtocol()

Returns the associated protocol supported for download.

default IRemoteFileResolver.ResolvedFile resolveRemoteFile(IRemoteFileResolver.RemoteFileResolverArgs args)

Resolve the remote file in a future-proof interface

default File resolveRemoteFiles(File consideredFile)

Resolve the remote file.

default File resolveRemoteFiles(File consideredFile, queryArgs)

Resolve the remote file.

default void setPrimaryDevice(ITestDevice device)

Optional way for the implementation to receive an {@ink ITestDevice} representation of the device under tests.

Public methods

getSupportedProtocol

public abstract String getSupportedProtocol ()

Returns the associated protocol supported for download.

Returns
String

resolveRemoteFile

public IRemoteFileResolver.ResolvedFile resolveRemoteFile (IRemoteFileResolver.RemoteFileResolverArgs args)

Resolve the remote file in a future-proof interface

Parameters
args IRemoteFileResolver.RemoteFileResolverArgs: RemoteFileResolverArgs describing the remote to download and how.

Returns
IRemoteFileResolver.ResolvedFile The resolved local file representation.

Throws
BuildRetrievalError if something goes wrong.

resolveRemoteFiles

public File resolveRemoteFiles (File consideredFile)

Resolve the remote file.

Parameters
consideredFile File: ERROR(/File) evaluated as remote.

Returns
File The resolved local file.

Throws
BuildRetrievalError if something goes wrong.

resolveRemoteFiles

public File resolveRemoteFiles (File consideredFile, 
                 queryArgs)

Resolve the remote file.

Parameters
consideredFile File: ERROR(/File) evaluated as remote.

queryArgs : The arguments passed as a query to the URL.

Returns
File The resolved local file.

Throws
BuildRetrievalError if something goes wrong.

setPrimaryDevice

public void setPrimaryDevice (ITestDevice device)

Optional way for the implementation to receive an {@ink ITestDevice} representation of the device under tests.

Parameters
device ITestDevice: The ITestDevice of the current invocation.