filebean.java
来自「一个图片管理程序」· Java 代码 · 共 57 行
JAVA
57 行
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 + =
减小字号Ctrl + -
显示快捷键?