📄 filebean.java
字号:
package com.sunnitech.bean;
import java.io.File;
public class FileBean {
public static boolean CreateUsrDir(String path, String newtag) {
boolean isOK = false;
File file = new File(path, newtag);
try {
file.mkdir();
isOK = true;
} catch(Exception e) {
System.out.println("make user dir error: " + e.getMessage());
}
return isOK;
}
public static boolean DeleteUsrDir(String path, String deltag) {
boolean isOK = false;
File file = new File(path, deltag);
try {
file.delete();
isOK = true;
} catch(Exception e) {
System.out.println("delete user dir error: " + e.getMessage());
}
return isOK;
}
public static boolean DelFile(String path, String file) {
boolean isOK = false;
File delfile = new File(path, file + ".jpg");
try {
delfile.delete();
isOK = true;
} catch(Exception e) {
System.out.println("delete big jpg file error: " + e.getMessage());
}
delfile = new File(path, file + "_m.jpg");
try {
delfile.delete();
isOK = true;
} catch(Exception e) {
System.out.println("delete small jpg file error: " + e.getMessage());
}
return isOK;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -