// 判断文件夹是否存在
public static void judeDirExists(File file) {
if (file.exists()) {
if (file.isDirectory()) {
System.out.println("dir exists");
} else {
System.out.println("the same name file exists, can not create dir");
}
} else {
System.out.println("dir not exists, create it ...");
file.mkdir();
}
}
java上传文件到文件夹判断文件夹是否存在,不存在则创建
最新推荐文章于 2024-08-22 18:05:20 发布