Stay organized with collections
Save and categorize content based on your preferences.
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# OpenOption\n\nAdded in [API level 26](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: \n\nOpenOption\n==========\n\n\n`\npublic\n\n\ninterface\nOpenOption\n`\n\n\n`\n\n\n`\n\n|--------------------------|\n| java.nio.file.OpenOption |\n\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [LinkOption](/reference/java/nio/file/LinkOption), [StandardOpenOption](/reference/java/nio/file/StandardOpenOption) |-------------------------------------------------------------------|-----------------------------------------------------------| | [LinkOption](/reference/java/nio/file/LinkOption) | Defines the options as to how symbolic links are handled. | | [StandardOpenOption](/reference/java/nio/file/StandardOpenOption) | Defines the standard open options. | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nAn object that configures how to open or create a file.\n\nObjects of this type are used by methods such as [newOutputStream](/reference/java/nio/file/Files#newOutputStream(java.nio.file.Path,%20java.nio.file.OpenOption[])), [newByteChannel](/reference/java/nio/file/Files#newByteChannel(java.nio.file.Path,%20java.nio.file.OpenOption[])), [FileChannel.open](/reference/java/nio/channels/FileChannel#open(java.nio.file.Path,%20java.nio.file.OpenOption[])), and [AsynchronousFileChannel.open](/reference/java/nio/channels/AsynchronousFileChannel#open(java.nio.file.Path,%20java.nio.file.OpenOption[]))\nwhen opening or creating a file.\n\nThe [StandardOpenOption](/reference/java/nio/file/StandardOpenOption) enumeration type defines the\n*standard* options."]]