/**
* 增加权限,使路径可上传文件
*/
public static void addChmod777(String filePath) throws IOException {
if (!System.getProperty("os.name").startsWith("Win")) {
String cmdGrant = "chmod 777 " + filePath;
BaseLogMethod.logInfo(TAG, "File Augmentation after Moving:" + cmdGrant);
Runtime.getRuntime().exec(cmdGrant);
}
}
/**
* 增加权限,使路径及子路径都有权限
*/
public static void addRChmod777(String filePath) throws IOException {
if (!System.getProperty("os.name").startsWith("Win")) {
String cmdGrant = "chmod -R 777 " + filePath;
BaseLogMethod.logInfo(TAG, ".addRChmod777: File Augmentation after Moving:" + cmdGrant);
Runtime.getRuntime().exec(cmdGrant);
}
}
java 为文件及文件夹添加权限
最新推荐文章于 2023-09-05 05:41:53 发布