RemoteFileUtil

public class RemoteFileUtil
extends Object

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


用于处理来自远程实例的文件的实用程序类

摘要

公共构造函数

RemoteFileUtil()

公共方法

static boolean doesRemoteFileExist(GceAvdInfo remoteInstance, TestDeviceOptions options, IRunUtil runUtil, long timeout, String remotePath)

检查远程实例中是否存在文件(或目录)

static File fetchRemoteDir(GceAvdInfo remoteInstance, TestDeviceOptions options, IRunUtil runUtil, long timeout, String remoteDirPath)

从远程主机提取远程目录。

static boolean fetchRemoteDir(GceAvdInfo remoteInstance, TestDeviceOptions options, IRunUtil runUtil, long timeout, String remoteDirPath, File localDir)

从远程主机提取远程目录。

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

在容器实例中提取远程文件。

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

在设备或容器实例中提取远程文件。

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

ERROR(/File) 从本地主机推送到远程实例

公共构造函数

RemoteFileUtil

public RemoteFileUtil ()

公共方法

doesRemoteFileExist

public static boolean doesRemoteFileExist (GceAvdInfo remoteInstance, 
                TestDeviceOptions options, 
                IRunUtil runUtil, 
                long timeout, 
                String remotePath)

检查远程实例上是否存在文件(或目录)

参数
remoteInstance GceAvdInfo:用于描述设备的 GceAvdInfo

options TestDeviceOptions:一个 TestDeviceOptions,用于描述要为 GCE 设备使用的设备选项。

runUtil IRunUtil:用于执行命令的 IRunUtil

timeout long:提取完成所需的毫秒数

remotePath String:用于查找文件的远程路径。

返回
boolean 文件是否存在

fetchRemoteDir

public static File fetchRemoteDir (GceAvdInfo remoteInstance, 
                TestDeviceOptions options, 
                IRunUtil runUtil, 
                long timeout, 
                String remoteDirPath)

从远程主机提取远程目录。

参数
remoteInstance GceAvdInfo:用于描述设备的 GceAvdInfo

options TestDeviceOptions:一个 TestDeviceOptions,用于描述要为 GCE 设备使用的设备选项。

runUtil IRunUtil:用于执行命令的 IRunUtil

timeout long:提取完成所需的毫秒数

remoteDirPath String:用于查找目录的远程路径。

返回
File 如果成功,则为拉取的目录 ERROR(/File);否则为 null

fetchRemoteDir

public static boolean fetchRemoteDir (GceAvdInfo remoteInstance, 
                TestDeviceOptions options, 
                IRunUtil runUtil, 
                long timeout, 
                String remoteDirPath, 
                File localDir)

从远程主机提取远程目录。

参数
remoteInstance GceAvdInfo:用于描述设备的 GceAvdInfo

options TestDeviceOptions:一个 TestDeviceOptions,用于描述要为 GCE 设备使用的设备选项。

runUtil IRunUtil:用于执行命令的 IRunUtil

timeout long:提取完成所需的毫秒数

remoteDirPath String:用于查找目录的远程路径。

localDir File:用于放置拉取的文件的本地目录。

返回
boolean 如果成功则返回 true,否则返回 false

fetchRemoteFile

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

在容器实例中提取远程文件。

参数
remoteInstance GceAvdInfo:用于描述设备的 GceAvdInfo

options TestDeviceOptions:一个 TestDeviceOptions,用于描述要为 GCE 设备使用的设备选项。

runUtil IRunUtil:用于执行命令的 IRunUtil

timeout long:提取完成所需的毫秒数

remoteFilePath String:用于查找文件的远程路径。

返回
File 如果成功,则为拉取的文件;否则为 null

fetchRemoteFile

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

在设备或容器实例中提取远程文件。

参数
remoteInstance GceAvdInfo:用于描述设备的 GceAvdInfo

options TestDeviceOptions:一个 TestDeviceOptions,用于描述要为 GCE 设备使用的设备选项。

runUtil IRunUtil:用于执行命令的 IRunUtil

timeout long:提取完成所需的毫秒数

remoteFilePath String:用于查找文件的远程路径。

localFile File:将拉取远程文件的本地 ERROR(/File)

返回
boolean 如果成功则返回 true,否则返回 false

pushFileToRemote

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

ERROR(/File) 从本地主机推送到远程实例

参数
remoteInstance GceAvdInfo:用于描述设备的 GceAvdInfo

options TestDeviceOptions:一个 TestDeviceOptions,用于描述要为 GCE 设备使用的设备选项。

scpArgs :要传递给 scp 命令的额外参数

runUtil IRunUtil:用于执行命令的 IRunUtil

timeout long:提取完成所需的毫秒数

remoteFilePath String:用于查找文件的远程路径。

localFile File:将拉取远程文件的本地 ERROR(/File)

返回
boolean 如果成功则返回 true,否则返回 false