RemoteFileUtil

public class RemoteFileUtil
extends Object

java.lang.Object
   ↳ com.android.tradefed.device.cloud.RemoteFileUtil


Utility class to handle file from a remote instance

Summary

Public constructors

RemoteFileUtil()

Public methods

static File fetchRemoteFile(GceAvdInfo remoteInstance, TestDeviceOptions options, IRunUtil runUtil, long timeout, String remoteFilePath)

Fetch a remote file in the container instance.

static boolean fetchRemoteFile(GceAvdInfo remoteInstance, TestDeviceOptions options, IRunUtil runUtil, long timeout, String remoteFilePath, File localFile)

Fetch a remote file in the device or container instance.

static boolean pushFileToRemote(GceAvdInfo remoteInstance, TestDeviceOptions options, scpArgs, IRunUtil runUtil, long timeout, String remoteFilePath, File localFile)

Push a ERROR(/File) from the local host to the remote instance

Public constructors

RemoteFileUtil

public RemoteFileUtil ()

Public methods

fetchRemoteFile

public static File fetchRemoteFile (GceAvdInfo remoteInstance, 
                TestDeviceOptions options, 
                IRunUtil runUtil, 
                long timeout, 
                String remoteFilePath)

Fetch a remote file in the container instance.

Parameters
remoteInstance GceAvdInfo: The GceAvdInfo that describe the device.

options TestDeviceOptions: a TestDeviceOptions describing the device options to be used for the GCE device.

runUtil IRunUtil: a IRunUtil to execute commands.

timeout long: in millisecond for the fetch to complete

remoteFilePath String: The remote path where to find the file.

Returns
File True if successful, False otherwise

fetchRemoteFile

public static boolean fetchRemoteFile (GceAvdInfo remoteInstance, 
                TestDeviceOptions options, 
                IRunUtil runUtil, 
                long timeout, 
                String remoteFilePath, 
                File localFile)

Fetch a remote file in the device or container instance.

Parameters
remoteInstance GceAvdInfo: The GceAvdInfo that describe the device.

options TestDeviceOptions: a TestDeviceOptions describing the device options to be used for the GCE device.

runUtil IRunUtil: a IRunUtil to execute commands.

timeout long: in millisecond for the fetch to complete

remoteFilePath String: The remote path where to find the file.

localFile File: The local ERROR(/File) where the remote file will be pulled

Returns
boolean True if successful, False otherwise

pushFileToRemote

public static boolean pushFileToRemote (GceAvdInfo remoteInstance, 
                TestDeviceOptions options, 
                 scpArgs, 
                IRunUtil runUtil, 
                long timeout, 
                String remoteFilePath, 
                File localFile)

Push a ERROR(/File) from the local host to the remote instance

Parameters
remoteInstance GceAvdInfo: The GceAvdInfo that describe the device.

options TestDeviceOptions: a TestDeviceOptions describing the device options to be used for the GCE device.

scpArgs : extra args to be passed to the scp command

runUtil IRunUtil: a IRunUtil to execute commands.

timeout long: in millisecond for the fetch to complete

remoteFilePath String: The remote path where to find the file.

localFile File: The local ERROR(/File) where the remote file will be pulled

Returns
boolean True if successful, False otherwise