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),否則為空值

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 成功時會傳回已拉取的欄位,否則為空值

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