JAVA初始化文件代码

//初始化路径
File file = new File(SavePath);
            if (!file.exists()) {
                file.mkdirs();
            }
 
//初始化文件
String filePath=SavePath+fileName;
            file = new File(filePath);
            if (!file.exists()) {
                file.createNewFile();
            }
原文地址:https://www.cnblogs.com/caichaoxiang919/p/10980950.html