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();