遠端檔案工具程式

public class RemoteFileUtil
extends Object

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


處理遠端執行個體中檔案的公用程式類別

摘要

公用建構函式

RemoteFileUtil()

公用方法

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) 從本機主機推送至遠端執行個體

公用建構函式

遠端檔案工具程式

public RemoteFileUtil ()

公用方法

擷取 RemoteDir

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) 表示成功,否則傳回空值

擷取 RemoteDir

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 提取的檔案如果成功,則為空值,否則傳回空值

擷取遠端檔案

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

PushFileToRemote

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