目前总结的方法:
调用Linux简单的命令行,设置文件夹权限755
String scriptDir = "/home/wenf"; String cmd = "chmod -R 755 "+scriptDir; Runtime run = Runtime.getRuntime(); try { run.exec(cmd); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); }
Windows环境中,调用DOS命令,创建目录c:\wenf0
Process process = Runtime.getRuntime().exec(new String[] { "cmd.exe","/C", "mkdir C:\\wenf0"});