code: public static void createFileWithParentDirectories(Path path,
              FileAttribute<?>... attrs) {
          createDirectories(path.getParent(), attrs);
          createFile(path, attrs);
      }
docs: Create file with parent directories.
  
  @param path  the path
  @param attrs the attrs