使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
TargetFileUtils
public
class
TargetFileUtils
extends Object
java.lang.Object 中
|
↳ |
com.android.tradefed.util.TargetFileUtils
|
摘要
公共构造函数
TargetFileUtils
public TargetFileUtils ()
公共方法
findFile
public static findFile (String path,
String namePattern,
options,
ITestDevice device)
一种辅助方法,用于执行 adb shell find 命令并将结果作为 ERROR(/ArrayList)
返回。
参数 |
path |
String :在设备上搜索的路径。 |
namePattern |
String :文件名模式。 |
options |
:String 的 ERROR(/List) ,用于查找其他选项传递。 |
device |
ITestDevice :测试设备。 |
getPermission
public static String getPermission (String filepath,
ITestDevice device)
读取路径的文件权限位。
参数 |
filepath |
String :文件或目录的路径。 |
device |
ITestDevice :测试设备。 |
hasPermission
public static boolean hasPermission (TargetFileUtils.FilePermission permission,
String permissionBits)
确定权限位是否向任何群组授予指定权限。
参数 |
permission |
TargetFileUtils.FilePermission :指定权限。 |
permissionBits |
String :八进制权限字符串(例如 741)。 |
返回 |
boolean |
如果任何所有者/群组/全局具有指定权限,则为 true。 |
isReadOnly
public static boolean isReadOnly (String filepath,
ITestDevice device)
检查给定路径的权限是否为只读。
参数 |
filepath |
String :文件或目录的路径。 |
device |
ITestDevice :测试设备。 |
返回 |
boolean |
如果路径为只读,则返回 true,否则返回 false。 |
isReadWriteOnly
public static boolean isReadWriteOnly (String filepath,
ITestDevice device)
检查给定路径的权限是否为读写权限。
参数 |
filepath |
String :文件或目录的路径。 |
device |
ITestDevice :测试设备。 |
返回 |
boolean |
如果路径为读写,则返回 true,否则返回 false。 |
本页面上的内容和代码示例受内容许可部分所述许可的限制。Java 和 OpenJDK 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-08-29。
[[["易于理解","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"]],["最后更新时间 (UTC):2024-08-29。"],[],[]]