目標文件實用程式

public class TargetFileUtils
extends Object

java.lang.Object
com.android.tradefed.util.TargetFileUtils


概括

公共構造函數

TargetFileUtils ()

公共方法

static findFile (String path, String namePattern, options, ITestDevice device) findFile (String path, String namePattern, options, ITestDevice device)

執行 adb shell find 指令並將結果當作ERROR(/ArrayList ) ERROR(/ArrayList )

static String getPermission (String filepath, ITestDevice device)

讀取路徑的檔案權限位。

static boolean hasPermission ( TargetFileUtils.FilePermission permission, String permissionBits)

確定權限位是否向任何群組授予指定權限。

static boolean isReadOnly (String filepath, ITestDevice device)

檢查給定路徑的權限是否為唯讀。

static boolean isReadWriteOnly (String filepath, ITestDevice device)

檢查給定路徑的權限是否為讀取和寫入。

公共構造函數

目標文件實用程式

public TargetFileUtils ()

公共方法

尋找文件

public static  findFile (String path, 
                String namePattern, 
                 options, 
                ITestDevice device)

執行 adb shell find 指令並將結果當作ERROR(/ArrayList ) ERROR(/ArrayList )

參數
path String : 在裝置上搜尋的路徑。

namePattern String :檔案名稱模式。

options :其他選項傳遞查找的String ERROR(/List)

device ITestDevice :測試設備。

退貨
結果為ERROR(/ArrayList ) ERROR(/ArrayList )

投擲
DeviceNotAvailableException如果與設備的連線遺失且無法恢復。

獲得許可

public static String getPermission (String filepath, 
                ITestDevice device)

讀取路徑的檔案權限位。

參數
filepath String :檔案或目錄的路徑。

device ITestDevice :測試設備。

退貨
String路徑的八進制權限位。

投擲
DeviceNotAvailableException

有權限

public static boolean hasPermission (TargetFileUtils.FilePermission permission, 
                String permissionBits)

確定權限位是否向任何群組授予指定權限。

參數
permission TargetFileUtils.FilePermission :指定權限。

permissionBits String :八進位權限字串(例如 741)。

退貨
boolean如果任何所有者/群組/全域具有指定權限,則為 True。

是唯讀的

public static boolean isReadOnly (String filepath, 
                ITestDevice device)

檢查給定路徑的權限是否為唯讀。

參數
filepath String :檔案或目錄的路徑。

device ITestDevice :測試設備。

退貨
boolean如果路徑是唯讀的,則為 true,否則為 false。

投擲
DeviceNotAvailableException

只讀

public static boolean isReadWriteOnly (String filepath, 
                ITestDevice device)

檢查給定路徑的權限是否為讀取和寫入。

參數
filepath String :檔案或目錄的路徑。

device ITestDevice :測試設備。

退貨
boolean如果路徑可讀寫,則為 true,否則為 false。

投擲
DeviceNotAvailableException