创建文件夹
public static void main(String[] args) throws IOException {
String path = "D:\\hello\\world";
System.out.println(createNewFilePath(path));
String file = "D:\\hello\\world.md";
System.out.println(createNewFile(file));
}
static boolean createNewFile(String path) throws IOException {
File file = new File(path);
System.out.println(file);
if (file.createNewFile()){
return true;
}
return false;
}
static boolean createNewFilePath(String path){
File file = new File(path);
System.out.println(file);
if (file.mkdirs()){
return true;
}
return false;
}