public static @NotNull Path createDirectories(@NotNull Path path) throws IOException {
    try {
      tryCreateDirectory(path);
    }
    catch (FileAlreadyExistsException e) {
      throw e;
    }
    catch (IOException e) {
      Path parent = path.getParent();
      if (parent == null) {
        throw e;
      }
      createDirectories(parent);
      tryCreateDirectory(path);
    }
    return path;
  }
public static @NotNull Path createDirectories(@NotNull Path path)