java代码 创建文件夹的方法
1、
1 2 3 4 5 | String strPath = "E:\\a\\aa\\aaa.txt"; File file = new File(strPath); if(!file.exists())){ file.file.mkdirs(); } |
2、
1 2 3 4 5 6 7 | String strPath = "E:\\a\\aa\\aaa.txt"; File file = new File(strPath); File fileParent = file.getParentFile(); if(!fileParent.exists()){ fileParent.mkdirs(); } file.createNewFile(); |

浙公网安备 33010602011771号