mirror of
https://github.com/TonyJiangWJ/Auto.js.git
synced 2026-06-21 21:01:43 +08:00
fix: files.create() cannot create dir
This commit is contained in:
parent
61beabadb3
commit
ee17b27a79
@ -56,10 +56,15 @@ public class PFiles {
|
||||
}
|
||||
|
||||
public static boolean create(String path) {
|
||||
try {
|
||||
return new File(path).createNewFile();
|
||||
} catch (IOException e) {
|
||||
return false;
|
||||
File f = new File(path);
|
||||
if (path.endsWith(File.separator)) {
|
||||
return f.mkdir();
|
||||
} else {
|
||||
try {
|
||||
return f.createNewFile();
|
||||
} catch (IOException e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user