透過集合功能整理內容
你可以依據偏好儲存及分類內容。
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 ()
公用方法
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 :檔案的遠端路徑。 |
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 :要尋找目錄的遠端路徑。 |
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 |
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-03-26 (世界標準時間)。
[[["容易理解","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"]],["上次更新時間:2025-03-26 (世界標準時間)。"],[],[]]