fix: files.create() cannot create dir
This commit is contained in:
@@ -56,10 +56,15 @@ public class PFiles {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean create(String path) {
|
public static boolean create(String path) {
|
||||||
try {
|
File f = new File(path);
|
||||||
return new File(path).createNewFile();
|
if (path.endsWith(File.separator)) {
|
||||||
} catch (IOException e) {
|
return f.mkdir();
|
||||||
return false;
|
} else {
|
||||||
|
try {
|
||||||
|
return f.createNewFile();
|
||||||
|
} catch (IOException e) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user