遠程文件工具
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) 將 |
公共構造函數
遠程文件工具
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 | 文件是否存在 |
獲取遠程目錄
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 |
獲取遠程目錄
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 | 如果成功則拉取文件,否則為空 |
獲取遠程文件
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 |
推送文件到遠程
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 | |
runUtil | IRunUtil :用於執行命令的IRunUtil 。 |
timeout | long :以毫秒為單位完成提取 |
remoteFilePath | String :查找文件的遠程路徑。 |
localFile | File : 將拉取遠程文件的本地ERROR(/File) |
退貨 | |
---|---|
boolean | 如果成功則為 True,否則為 False |