使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
RemoteFileUtil
public
class
RemoteFileUtil
extends Object
java.lang.Object 中
|
↳ |
com.android.tradefed.device.cloud.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 ()
公共方法
doRemoteFileExist
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 :文件所在位置的远程路径。 |
获取远程目录
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 :用于查找目录的远程路径。 |
获取远程目录
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 |
远程提取文件
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 |
远程提取文件
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 |
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-29。
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["没有我需要的信息","missingTheInformationINeed","thumb-down"],["太复杂/步骤太多","tooComplicatedTooManySteps","thumb-down"],["内容需要更新","outOfDate","thumb-down"],["翻译问题","translationIssue","thumb-down"],["示例/代码问题","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2024-08-29。"],[],[]]