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)
| 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. |
nothing calls this directly
no test coverage detected