OpenOption acts like a configuration when you open or create files using package classes, you can pass multiple options at a time depends on the need, if no option is passed then it takes default value (default OpenOption value varies for different methods).

There are mainly two different sets of OpenOptions are available in Java, below classes implements the interface .

.READ public String read(String fileFullyQualifiedPath) throws IOException { InputStreamReader inputStreamReader = new InputStreamReader(Files.newInputStream(Path.of(fileFullyQualifiedPath), StandardOpenOption.READ)); BufferedReader bufferedReader = new BufferedReader(inputStreamReader); StringBuilder sb = new StringBuilder(); String line; while((line = bufferedReader.readLine()) != null) { sb.append(line); } return sb.toString(); }
.CREATE_NEW public void createNew(String fileFullyQualifiedPath, String text) throws IOException { Files.writeString(Path.of(fileFullyQualifiedPath),text, StandardOpenOption.CREATE_NEW); }
.CREATE public void createNew(String fileFullyQualifiedPath, String text) throws IOException { Files.writeString(Path.of(fileFullyQualifiedPath),text, StandardOpenOption.CREATE); }
.WRITE public void createNew(String fileFullyQualifiedPath, String text) throws IOException { Files.writeString(Path.of(fileFullyQualifiedPath),text, StandardOpenOption.WRITE); }
.APPEND public void append(String fileFullyQualifiedPath, String text) throws IOException { Files.writeString(Path.of(fileFullyQualifiedPath),text, StandardOpenOption.APPEND); }
.TRUNCATE_EXISTING public void append(String fileFullyQualifiedPath, String text) throws IOException { Files.writeString(Path.of(fileFullyQualifiedPath),text, StandardOpenOption.TRUNCATE_EXISTING); }
.SPARSE public void append(String fileFullyQualifiedPath, String text) throws IOException { Files.writeString(Path.of(fileFullyQualifiedPath),text, StandardOpenOption.TRUNCATE_EXISTING); }
.SYNC public void writeInSync(String fileFullyQualifiedPath, String text) throws IOException { Files.writeString(Path.of(fileFullyQualifiedPath), text, StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.SYNC); }
.DSYNC public void writeInSync(String fileFullyQualifiedPath, String text) throws IOException { Files.writeString(Path.of(fileFullyQualifiedPath), text, StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.SYNC); }
.DELETE_ON_CLOSE public void writeInSync(String fileFullyQualifiedPath, String text) throws IOException { Files.writeString(Path.of(fileFullyQualifiedPath), text, StandardOpenOption.CREATE, StandardOpenOption.WRITE, StandardOpenOption.SYNC); }
.NOFOLLOW_LINKS public boolean checkDirWithNoFollowLinks(String dir) { return Files.isDirectory(Path.of(dir), LinkOption.NOFOLLOW_LINKS); }

Above examples source code can be found at GitHub link for Java code and JUnit tests can be found at GitHub link for Unit tests code