code: public static NamedFileChannel createNewFile(Path dir, String prefix, String suffix) throws IOException {
          return createNewFileImpl(dir, prefix, suffix, new OpenOption[]{READ, WRITE, CREATE_NEW});
      }
docs: Creates a new file and opens it for reading and writing.