JAVA初始化文件代码

//初始化路径
File file = new File(SavePath);
            if (!file.exists()) {
                file.mkdirs();
            }
 
//初始化文件
String filePath=SavePath+fileName;
            file = new File(filePath);
            if (!file.exists()) {
                file.createNewFile();
            }
posted @ 2019-06-05 17:38  Sublamb  阅读(1174)  评论(0编辑  收藏  举报