java创建文件、创建文件夹

            File file = new File("D:\002\" + fileName + ".docx");
            if(!file.getParentFile().exists()){
                file.getParentFile().mkdir();
            }

            if(!file.exists()){
                boolean newFile = file.createNewFile();
            }
原文地址:https://www.cnblogs.com/qq376324789/p/14991188.html