远程文件工具

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) pushFileToRemote ( GceAvdInfo remoteInstance, TestDeviceOptions options, scpArgs, IRunUtil runUtil, long timeout, String remoteFilePath, File localFile)

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

公共构造函数

远程文件工具

public RemoteFileUtil ()

公共方法

远程文件是否存在

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

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

参数
remoteInstance GceAvdInfo :描述设备的GceAvdInfo

options TestDeviceOptionsTestDeviceOptions描述用于 GCE 设备的设备选项。

runUtil IRunUtil :执行命令的IRunUtil

timeout long :以毫秒为单位完成提取

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

退货
boolean文件是否存在

获取远程目录

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

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

参数
remoteInstance GceAvdInfo :描述设备的GceAvdInfo

options TestDeviceOptionsTestDeviceOptions描述用于 GCE 设备的设备选项。

runUtil IRunUtil :执行命令的IRunUtil

timeout long :以毫秒为单位完成提取

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

退货
File如果成功则拉取目录ERROR(/File) ,否则为 null

获取远程目录

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

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

参数
remoteInstance GceAvdInfo :描述设备的GceAvdInfo

options TestDeviceOptionsTestDeviceOptions描述用于 GCE 设备的设备选项。

runUtil IRunUtil :执行命令的IRunUtil

timeout long :以毫秒为单位完成提取

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

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

退货
boolean如果成功则为 True,否则为 False

获取远程文件

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

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

参数
remoteInstance GceAvdInfo :描述设备的GceAvdInfo

options TestDeviceOptionsTestDeviceOptions描述用于 GCE 设备的设备选项。

runUtil IRunUtil :执行命令的IRunUtil

timeout long :以毫秒为单位完成提取

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

退货
File如果成功则拉取文件,否则为 null

获取远程文件

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

获取设备或容器实例中的远程文件。

参数
remoteInstance GceAvdInfo :描述设备的GceAvdInfo

options TestDeviceOptionsTestDeviceOptions描述用于 GCE 设备的设备选项。

runUtil IRunUtil :执行命令的IRunUtil

timeout long :以毫秒为单位完成获取

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

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

退货
boolean如果成功则为 True,否则为 False

推送文件到远程

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

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

参数
remoteInstance GceAvdInfo :描述设备的GceAvdInfo

options TestDeviceOptionsTestDeviceOptions描述用于 GCE 设备的设备选项。

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

runUtil IRunUtil :执行命令的IRunUtil

timeout long :以毫秒为单位完成提取

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

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

退货
boolean如果成功则为 True,否则为 False