OpenOption

  • OpenOption is an interface used to configure how files are opened or created in Java NIO.

  • It is used by methods in Files, FileChannel, and AsynchronousFileChannel for file operations.

  • StandardOpenOption and LinkOption are implementations of OpenOption providing options for standard operations and symbolic link handling, respectively.

  • StandardOpenOption defines common options like CREATE, APPEND, and READ, while LinkOption controls whether symbolic links are followed.

public interface OpenOption
Known Indirect Subclasses

An object that configures how to open or create a file.

Objects of this type are used by methods such as newOutputStream, newByteChannel, FileChannel.open, and AsynchronousFileChannel.open when opening or creating a file.

The StandardOpenOption enumeration type defines the standard options.