?? fileoperate.java
字號:
package common;
import java.io.File;
public class FileOperate {
public FileOperate() {
}
/**
* 新建目錄
*
* @param folderPath
*
*/
public void createFolder(String folderPath) {
try {
java.io.File myFilePath = new java.io.File(folderPath);
if (!myFilePath.exists()) {
myFilePath.mkdir();
}
} catch (Exception e) {
}
}
/**
* 檢查目錄是否存在
*
* @param folderPath
*
*/
public boolean checkFolder(String folderPath) {
File myFilePath = new File(folderPath);
if (!myFilePath.exists()) {
return true;
} else {
return false;
}
}
/**
* 重命名目錄
*
* @param oldPath
* @param newPath
*/
public void renameFolder(String oldPath, String newPath) {
File f = new File(oldPath);
f.renameTo(new File(newPath));
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -