MCPcopy Create free account
hub / github.com/davidgiven/luje / mkdirs

Method mkdirs

lib/java/io/File.java:1188–1207  ·  view source on GitHub ↗

Creates the directory named by the trailing filename of this file, including the complete directory path required to create this directory. @return true if the necessary directories have been created, false if the target directory already exists or one of the directo

()

Source from the content-addressed store, hash-verified

1186 * @see #mkdir
1187 */
1188 public boolean mkdirs() {
1189 /* If the terminal directory already exists, answer false */
1190 if (exists()) {
1191 return false;
1192 }
1193
1194 /* If the receiver can be created, answer true */
1195 if (mkdir()) {
1196 return true;
1197 }
1198
1199 String parentDir = getParent();
1200 /* If there is no parent and we were not created, answer false */
1201 if (parentDir == null) {
1202 return false;
1203 }
1204
1205 /* Otherwise, try to create a parent directory and then this directory */
1206 return (new File(parentDir).mkdirs() && mkdir());
1207 }
1208
1209 /**
1210 * Creates a new, empty file on the file system according to the path

Callers

nothing calls this directly

Calls 3

existsMethod · 0.95
mkdirMethod · 0.95
getParentMethod · 0.95

Tested by

no test coverage detected