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) を push します。

パブリック コンストラクタ

RemoteFileUtil

public RemoteFileUtil ()

パブリック メソッド

doesRemoteFileExist

public static boolean doesRemoteFileExist (GceAvdInfo remoteInstance, 
                TestDeviceOptions options, 
                IRunUtil runUtil, 
                long timeout, 
                String remotePath)

リモート インスタンスにファイル(またはディレクトリ)が存在するかどうかを確認する

パラメータ
remoteInstance GceAvdInfo: デバイスを記述する GceAvdInfo

options TestDeviceOptions: GCE デバイスに使用するデバイス オプションを記述する TestDeviceOptions

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: GCE デバイスに使用するデバイス オプションを記述する TestDeviceOptions

runUtil IRunUtil: コマンドを実行する IRunUtil

timeout long: 取得が完了するまでの時間(ミリ秒単位)

remoteDirPath String: ディレクトリが存在するリモートパス。

戻り値
File プルされたディレクトリ(成功した場合は ERROR(/File)、それ以外の場合は null)

fetchRemoteDir

public static boolean fetchRemoteDir (GceAvdInfo remoteInstance, 
                TestDeviceOptions options, 
                IRunUtil runUtil, 
                long timeout, 
                String remoteDirPath, 
                File localDir)

リモート ホストからリモート ディレクトリを取得します。

パラメータ
remoteInstance GceAvdInfo: デバイスを記述する GceAvdInfo

options TestDeviceOptions: GCE デバイスに使用するデバイス オプションを記述する TestDeviceOptions

runUtil IRunUtil: コマンドを実行する IRunUtil

timeout long: 取得が完了するまでの時間(ミリ秒単位)

remoteDirPath String: ディレクトリが存在するリモートパス。

localDir File: pull したファイルを配置するローカル ディレクトリ。

戻り値
boolean 成功した場合は true、それ以外の場合は false

fetchRemoteFile

public static File fetchRemoteFile (GceAvdInfo remoteInstance, 
                TestDeviceOptions options, 
                IRunUtil runUtil, 
                long timeout, 
                String remoteFilePath)

コンテナ インスタンスでリモート ファイルを取得します。

パラメータ
remoteInstance GceAvdInfo: デバイスを記述する GceAvdInfo

options TestDeviceOptions: GCE デバイスに使用するデバイス オプションを記述する TestDeviceOptions

runUtil IRunUtil: コマンドを実行する IRunUtil

timeout long: 取得が完了するまでの時間(ミリ秒単位)

remoteFilePath String: ファイルが存在するリモートパス。

戻り値
File 正常に取得されたファイルの場合はそのファイル、それ以外の場合は null

fetchRemoteFile

public static boolean fetchRemoteFile (GceAvdInfo remoteInstance, 
                TestDeviceOptions options, 
                IRunUtil runUtil, 
                long timeout, 
                String remoteFilePath, 
                File localFile)

デバイスまたはコンテナ インスタンスでリモート ファイルを取得します。

パラメータ
remoteInstance GceAvdInfo: デバイスを記述する GceAvdInfo

options TestDeviceOptions: GCE デバイスに使用するデバイス オプションを記述する TestDeviceOptions

runUtil IRunUtil: コマンドを実行する IRunUtil

timeout long: 取得が完了するまでの時間(ミリ秒単位)

remoteFilePath String: ファイルが存在するリモートパス。

localFile File: リモート ファイルが pull されるローカル 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) を push する

パラメータ
remoteInstance GceAvdInfo: デバイスを記述する GceAvdInfo

options TestDeviceOptions: GCE デバイスに使用するデバイス オプションを記述する TestDeviceOptions

scpArgs : scp コマンドに渡す追加の引数

runUtil IRunUtil: コマンドを実行する IRunUtil

timeout long: 取得が完了するまでの時間(ミリ秒単位)

remoteFilePath String: ファイルが存在するリモートパス。

localFile File: リモート ファイルが pull されるローカル ERROR(/File)

戻り値
boolean 成功した場合は true、それ以外の場合は false