遠端檔案工具

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