TargetFileUtils

public class TargetFileUtils
extends Object

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


สรุป

ตัวสร้างแบบสาธารณะ

TargetFileUtils()

เมธอดสาธารณะ

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

เมธอดตัวช่วยที่เรียกใช้คําสั่ง adb shell find และแสดงผลลัพธ์เป็น 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)

ตรวจสอบว่าสิทธิ์สําหรับเส้นทางที่ระบุคือ readwrite หรือไม่

ตัวสร้างแบบสาธารณะ

TargetFileUtils

public TargetFileUtils ()

เมธอดสาธารณะ

findFile

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

เมธอดตัวช่วยที่เรียกใช้คําสั่ง adb shell find และแสดงผลลัพธ์เป็น ERROR(/ArrayList)

พารามิเตอร์
path String: เส้นทางการค้นหาในอุปกรณ์

namePattern String: รูปแบบชื่อไฟล์

options : ERROR(/List) ของ String สำหรับตัวเลือกอื่นๆ ที่ส่งผ่านเพื่อค้นหา

device ITestDevice: อุปกรณ์ทดสอบ

คิกรีเทิร์น
ผลการค้นหาใน ERROR(/ArrayList)

การโยน
DeviceNotAvailableException หากการเชื่อมต่อกับอุปกรณ์ขาดหายไปและกู้คืนไม่ได้

getPermission

public static String getPermission (String filepath, 
                ITestDevice device)

อ่านบิตสิทธิ์ของไฟล์ในเส้นทาง

พารามิเตอร์
filepath String: เส้นทางไปยังไฟล์หรือไดเรกทอรี

device ITestDevice: อุปกรณ์ทดสอบ

คิกรีเทิร์น
String บิตสิทธิ์แบบฐาน 8 สำหรับเส้นทาง

การโยน
DeviceNotAvailableException

hasPermission

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

ระบุว่าบิตสิทธิ์ให้สิทธิ์ที่ระบุแก่กลุ่มใดหรือไม่

พารามิเตอร์
permission TargetFileUtils.FilePermission: สิทธิ์ที่ระบุ

permissionBits String: สตริงสิทธิ์แบบฐาน 8 (เช่น 741)

คิกรีเทิร์น
boolean เป็นจริงหากเจ้าของ/กลุ่ม/ส่วนกลางมีสิทธิ์ที่ระบุ

isReadOnly

public static boolean isReadOnly (String filepath, 
                ITestDevice device)

ตรวจสอบว่าสิทธิ์สำหรับเส้นทางหนึ่งๆ เป็นสิทธิ์อ่านอย่างเดียวหรือไม่

พารามิเตอร์
filepath String: เส้นทางไปยังไฟล์หรือไดเรกทอรี

device ITestDevice: อุปกรณ์ทดสอบ

คิกรีเทิร์น
boolean จริงหากเส้นทางเป็นแบบอ่านอย่างเดียว เป็นเท็จหากไม่ใช่

การโยน
DeviceNotAvailableException

isReadWriteOnly

public static boolean isReadWriteOnly (String filepath, 
                ITestDevice device)

ตรวจสอบว่าสิทธิ์สําหรับเส้นทางที่ระบุคือ readwrite หรือไม่

พารามิเตอร์
filepath String: เส้นทางไปยังไฟล์หรือไดเรกทอรี

device ITestDevice: อุปกรณ์ทดสอบ

คิกรีเทิร์น
boolean จริงหากเส้นทางเป็นแบบอ่าน/เขียน เป็นเท็จหากไม่ใช่

การโยน
DeviceNotAvailableException