MCPcopy Create free account
hub / github.com/cinit/TMoe / makeParentDirsOrThrow

Method makeParentDirsOrThrow

app/src/main/java/cc/ioctl/tmoe/util/IoUtils.java:90–98  ·  view source on GitHub ↗

Used for create a parent directory if it does not exist. This will throw an unsafe IOException if the parent directory cannot be created. Only use this when you think mkdirs() must be successful. @param file the file whose parent directory will be created if it does not exist @retur

(@NonNull File file)

Source from the content-addressed store, hash-verified

88 * @return the same file as the parameter
89 */
90 @NonNull
91 public static File makeParentDirsOrThrow(@NonNull File file) {
92 Objects.requireNonNull(file, "file == null");
93 File parent = file.getParentFile();
94 if (parent != null && !parent.exists()) {
95 mkdirsOrThrow(parent);
96 }
97 return file;
98 }
99
100 /**
101 * Used to create a directory if it does not exist.

Callers

nothing calls this directly

Calls 1

mkdirsOrThrowMethod · 0.95

Tested by

no test coverage detected