code: public static FileChannel createTempFile(Path dir, String prefix, String suffix) throws IOException {
          return createNewFileImpl(dir, prefix, suffix, new OpenOption[]{READ, WRITE, CREATE_NEW, DELETE_ON_CLOSE}).getFileChannel();
      }
docs: Create a temporary file that will be removed when it is closed.