/**
* 建立資料夾(先檢查存不存在)
*/
public void createFold(String foldName) {
File theDir = new File(foldName);
// if the directory does not exist, create it
if (!theDir.exists()) {
System.out.println("creating directory: " + foldName);
boolean result = false;
try {
theDir.mkdir();
result = true;
} catch (SecurityException se) {
//handle it
}
if (result) {
System.out.println("DIR created");
}
}
}
沒有留言:
張貼留言