com.sun.nio.file.ExtendedOpenOption Java Examples
The following examples show how to use
com.sun.nio.file.ExtendedOpenOption.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WindowsChannelFactory.java From dragonwell8_jdk with GNU General Public License v2.0 | 4 votes |
static Flags toFlags(Set<? extends OpenOption> options) { Flags flags = new Flags(); for (OpenOption option: options) { if (option instanceof StandardOpenOption) { switch ((StandardOpenOption)option) { case READ : flags.read = true; break; case WRITE : flags.write = true; break; case APPEND : flags.append = true; break; case TRUNCATE_EXISTING : flags.truncateExisting = true; break; case CREATE : flags.create = true; break; case CREATE_NEW : flags.createNew = true; break; case DELETE_ON_CLOSE : flags.deleteOnClose = true; break; case SPARSE : flags.sparse = true; break; case SYNC : flags.sync = true; break; case DSYNC : flags.dsync = true; break; default: throw new UnsupportedOperationException(); } continue; } if (option instanceof ExtendedOpenOption) { switch ((ExtendedOpenOption)option) { case NOSHARE_READ : flags.shareRead = false; break; case NOSHARE_WRITE : flags.shareWrite = false; break; case NOSHARE_DELETE : flags.shareDelete = false; break; default: throw new UnsupportedOperationException(); } continue; } if (option == LinkOption.NOFOLLOW_LINKS) { flags.noFollowLinks = true; continue; } if (option == OPEN_REPARSE_POINT) { flags.openReparsePoint = true; continue; } if (option == null) throw new NullPointerException(); throw new UnsupportedOperationException(); } return flags; }
Example #2
Source File: WindowsChannelFactory.java From TencentKona-8 with GNU General Public License v2.0 | 4 votes |
static Flags toFlags(Set<? extends OpenOption> options) { Flags flags = new Flags(); for (OpenOption option: options) { if (option instanceof StandardOpenOption) { switch ((StandardOpenOption)option) { case READ : flags.read = true; break; case WRITE : flags.write = true; break; case APPEND : flags.append = true; break; case TRUNCATE_EXISTING : flags.truncateExisting = true; break; case CREATE : flags.create = true; break; case CREATE_NEW : flags.createNew = true; break; case DELETE_ON_CLOSE : flags.deleteOnClose = true; break; case SPARSE : flags.sparse = true; break; case SYNC : flags.sync = true; break; case DSYNC : flags.dsync = true; break; default: throw new UnsupportedOperationException(); } continue; } if (option instanceof ExtendedOpenOption) { switch ((ExtendedOpenOption)option) { case NOSHARE_READ : flags.shareRead = false; break; case NOSHARE_WRITE : flags.shareWrite = false; break; case NOSHARE_DELETE : flags.shareDelete = false; break; default: throw new UnsupportedOperationException(); } continue; } if (option == LinkOption.NOFOLLOW_LINKS) { flags.noFollowLinks = true; continue; } if (option == OPEN_REPARSE_POINT) { flags.openReparsePoint = true; continue; } if (option == null) throw new NullPointerException(); throw new UnsupportedOperationException(); } return flags; }
Example #3
Source File: WindowsChannelFactory.java From jdk8u60 with GNU General Public License v2.0 | 4 votes |
static Flags toFlags(Set<? extends OpenOption> options) { Flags flags = new Flags(); for (OpenOption option: options) { if (option instanceof StandardOpenOption) { switch ((StandardOpenOption)option) { case READ : flags.read = true; break; case WRITE : flags.write = true; break; case APPEND : flags.append = true; break; case TRUNCATE_EXISTING : flags.truncateExisting = true; break; case CREATE : flags.create = true; break; case CREATE_NEW : flags.createNew = true; break; case DELETE_ON_CLOSE : flags.deleteOnClose = true; break; case SPARSE : flags.sparse = true; break; case SYNC : flags.sync = true; break; case DSYNC : flags.dsync = true; break; default: throw new UnsupportedOperationException(); } continue; } if (option instanceof ExtendedOpenOption) { switch ((ExtendedOpenOption)option) { case NOSHARE_READ : flags.shareRead = false; break; case NOSHARE_WRITE : flags.shareWrite = false; break; case NOSHARE_DELETE : flags.shareDelete = false; break; default: throw new UnsupportedOperationException(); } continue; } if (option == LinkOption.NOFOLLOW_LINKS) { flags.noFollowLinks = true; continue; } if (option == OPEN_REPARSE_POINT) { flags.openReparsePoint = true; continue; } if (option == null) throw new NullPointerException(); throw new UnsupportedOperationException(); } return flags; }
Example #4
Source File: WindowsChannelFactory.java From openjdk-jdk8u with GNU General Public License v2.0 | 4 votes |
static Flags toFlags(Set<? extends OpenOption> options) { Flags flags = new Flags(); for (OpenOption option: options) { if (option instanceof StandardOpenOption) { switch ((StandardOpenOption)option) { case READ : flags.read = true; break; case WRITE : flags.write = true; break; case APPEND : flags.append = true; break; case TRUNCATE_EXISTING : flags.truncateExisting = true; break; case CREATE : flags.create = true; break; case CREATE_NEW : flags.createNew = true; break; case DELETE_ON_CLOSE : flags.deleteOnClose = true; break; case SPARSE : flags.sparse = true; break; case SYNC : flags.sync = true; break; case DSYNC : flags.dsync = true; break; default: throw new UnsupportedOperationException(); } continue; } if (option instanceof ExtendedOpenOption) { switch ((ExtendedOpenOption)option) { case NOSHARE_READ : flags.shareRead = false; break; case NOSHARE_WRITE : flags.shareWrite = false; break; case NOSHARE_DELETE : flags.shareDelete = false; break; default: throw new UnsupportedOperationException(); } continue; } if (option == LinkOption.NOFOLLOW_LINKS) { flags.noFollowLinks = true; continue; } if (option == OPEN_REPARSE_POINT) { flags.openReparsePoint = true; continue; } if (option == null) throw new NullPointerException(); throw new UnsupportedOperationException(); } return flags; }
Example #5
Source File: WindowsChannelFactory.java From hottub with GNU General Public License v2.0 | 4 votes |
static Flags toFlags(Set<? extends OpenOption> options) { Flags flags = new Flags(); for (OpenOption option: options) { if (option instanceof StandardOpenOption) { switch ((StandardOpenOption)option) { case READ : flags.read = true; break; case WRITE : flags.write = true; break; case APPEND : flags.append = true; break; case TRUNCATE_EXISTING : flags.truncateExisting = true; break; case CREATE : flags.create = true; break; case CREATE_NEW : flags.createNew = true; break; case DELETE_ON_CLOSE : flags.deleteOnClose = true; break; case SPARSE : flags.sparse = true; break; case SYNC : flags.sync = true; break; case DSYNC : flags.dsync = true; break; default: throw new UnsupportedOperationException(); } continue; } if (option instanceof ExtendedOpenOption) { switch ((ExtendedOpenOption)option) { case NOSHARE_READ : flags.shareRead = false; break; case NOSHARE_WRITE : flags.shareWrite = false; break; case NOSHARE_DELETE : flags.shareDelete = false; break; default: throw new UnsupportedOperationException(); } continue; } if (option == LinkOption.NOFOLLOW_LINKS) { flags.noFollowLinks = true; continue; } if (option == OPEN_REPARSE_POINT) { flags.openReparsePoint = true; continue; } if (option == null) throw new NullPointerException(); throw new UnsupportedOperationException(); } return flags; }
Example #6
Source File: WindowsChannelFactory.java From openjdk-8-source with GNU General Public License v2.0 | 4 votes |
static Flags toFlags(Set<? extends OpenOption> options) { Flags flags = new Flags(); for (OpenOption option: options) { if (option instanceof StandardOpenOption) { switch ((StandardOpenOption)option) { case READ : flags.read = true; break; case WRITE : flags.write = true; break; case APPEND : flags.append = true; break; case TRUNCATE_EXISTING : flags.truncateExisting = true; break; case CREATE : flags.create = true; break; case CREATE_NEW : flags.createNew = true; break; case DELETE_ON_CLOSE : flags.deleteOnClose = true; break; case SPARSE : flags.sparse = true; break; case SYNC : flags.sync = true; break; case DSYNC : flags.dsync = true; break; default: throw new UnsupportedOperationException(); } continue; } if (option instanceof ExtendedOpenOption) { switch ((ExtendedOpenOption)option) { case NOSHARE_READ : flags.shareRead = false; break; case NOSHARE_WRITE : flags.shareWrite = false; break; case NOSHARE_DELETE : flags.shareDelete = false; break; default: throw new UnsupportedOperationException(); } continue; } if (option == LinkOption.NOFOLLOW_LINKS) { flags.noFollowLinks = true; continue; } if (option == OPEN_REPARSE_POINT) { flags.openReparsePoint = true; continue; } if (option == null) throw new NullPointerException(); throw new UnsupportedOperationException(); } return flags; }
Example #7
Source File: OpenFileUtils.java From herddb with Apache License 2.0 | 4 votes |
public static FileChannel openFileChannelWithO_DIRECT(Path path, OpenOption... options) throws IOException { OpenOption[] options2 = new OpenOption[options.length + 1]; System.arraycopy(options, 0, options2, 0, options.length); options2[options2.length - 1] = ExtendedOpenOption.DIRECT; return FileChannel.open(path, options2); }
Example #8
Source File: WindowsChannelFactory.java From openjdk-8 with GNU General Public License v2.0 | 4 votes |
static Flags toFlags(Set<? extends OpenOption> options) { Flags flags = new Flags(); for (OpenOption option: options) { if (option instanceof StandardOpenOption) { switch ((StandardOpenOption)option) { case READ : flags.read = true; break; case WRITE : flags.write = true; break; case APPEND : flags.append = true; break; case TRUNCATE_EXISTING : flags.truncateExisting = true; break; case CREATE : flags.create = true; break; case CREATE_NEW : flags.createNew = true; break; case DELETE_ON_CLOSE : flags.deleteOnClose = true; break; case SPARSE : flags.sparse = true; break; case SYNC : flags.sync = true; break; case DSYNC : flags.dsync = true; break; default: throw new UnsupportedOperationException(); } continue; } if (option instanceof ExtendedOpenOption) { switch ((ExtendedOpenOption)option) { case NOSHARE_READ : flags.shareRead = false; break; case NOSHARE_WRITE : flags.shareWrite = false; break; case NOSHARE_DELETE : flags.shareDelete = false; break; default: throw new UnsupportedOperationException(); } continue; } if (option == LinkOption.NOFOLLOW_LINKS) { flags.noFollowLinks = true; continue; } if (option == OPEN_REPARSE_POINT) { flags.openReparsePoint = true; continue; } if (option == null) throw new NullPointerException(); throw new UnsupportedOperationException(); } return flags; }
Example #9
Source File: WindowsChannelFactory.java From jdk8u_jdk with GNU General Public License v2.0 | 4 votes |
static Flags toFlags(Set<? extends OpenOption> options) { Flags flags = new Flags(); for (OpenOption option: options) { if (option instanceof StandardOpenOption) { switch ((StandardOpenOption)option) { case READ : flags.read = true; break; case WRITE : flags.write = true; break; case APPEND : flags.append = true; break; case TRUNCATE_EXISTING : flags.truncateExisting = true; break; case CREATE : flags.create = true; break; case CREATE_NEW : flags.createNew = true; break; case DELETE_ON_CLOSE : flags.deleteOnClose = true; break; case SPARSE : flags.sparse = true; break; case SYNC : flags.sync = true; break; case DSYNC : flags.dsync = true; break; default: throw new UnsupportedOperationException(); } continue; } if (option instanceof ExtendedOpenOption) { switch ((ExtendedOpenOption)option) { case NOSHARE_READ : flags.shareRead = false; break; case NOSHARE_WRITE : flags.shareWrite = false; break; case NOSHARE_DELETE : flags.shareDelete = false; break; default: throw new UnsupportedOperationException(); } continue; } if (option == LinkOption.NOFOLLOW_LINKS) { flags.noFollowLinks = true; continue; } if (option == OPEN_REPARSE_POINT) { flags.openReparsePoint = true; continue; } if (option == null) throw new NullPointerException(); throw new UnsupportedOperationException(); } return flags; }
Example #10
Source File: WindowsChannelFactory.java From jdk8u-jdk with GNU General Public License v2.0 | 4 votes |
static Flags toFlags(Set<? extends OpenOption> options) { Flags flags = new Flags(); for (OpenOption option: options) { if (option instanceof StandardOpenOption) { switch ((StandardOpenOption)option) { case READ : flags.read = true; break; case WRITE : flags.write = true; break; case APPEND : flags.append = true; break; case TRUNCATE_EXISTING : flags.truncateExisting = true; break; case CREATE : flags.create = true; break; case CREATE_NEW : flags.createNew = true; break; case DELETE_ON_CLOSE : flags.deleteOnClose = true; break; case SPARSE : flags.sparse = true; break; case SYNC : flags.sync = true; break; case DSYNC : flags.dsync = true; break; default: throw new UnsupportedOperationException(); } continue; } if (option instanceof ExtendedOpenOption) { switch ((ExtendedOpenOption)option) { case NOSHARE_READ : flags.shareRead = false; break; case NOSHARE_WRITE : flags.shareWrite = false; break; case NOSHARE_DELETE : flags.shareDelete = false; break; default: throw new UnsupportedOperationException(); } continue; } if (option == LinkOption.NOFOLLOW_LINKS) { flags.noFollowLinks = true; continue; } if (option == OPEN_REPARSE_POINT) { flags.openReparsePoint = true; continue; } if (option == null) throw new NullPointerException(); throw new UnsupportedOperationException(); } return flags; }
Example #11
Source File: WindowsChannelFactory.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 4 votes |
static Flags toFlags(Set<? extends OpenOption> options) { Flags flags = new Flags(); for (OpenOption option: options) { if (option instanceof StandardOpenOption) { switch ((StandardOpenOption)option) { case READ : flags.read = true; break; case WRITE : flags.write = true; break; case APPEND : flags.append = true; break; case TRUNCATE_EXISTING : flags.truncateExisting = true; break; case CREATE : flags.create = true; break; case CREATE_NEW : flags.createNew = true; break; case DELETE_ON_CLOSE : flags.deleteOnClose = true; break; case SPARSE : flags.sparse = true; break; case SYNC : flags.sync = true; break; case DSYNC : flags.dsync = true; break; default: throw new UnsupportedOperationException(); } continue; } if (option instanceof ExtendedOpenOption) { switch ((ExtendedOpenOption)option) { case NOSHARE_READ : flags.shareRead = false; break; case NOSHARE_WRITE : flags.shareWrite = false; break; case NOSHARE_DELETE : flags.shareDelete = false; break; default: throw new UnsupportedOperationException(); } continue; } if (option == LinkOption.NOFOLLOW_LINKS) { flags.noFollowLinks = true; continue; } if (option == OPEN_REPARSE_POINT) { flags.openReparsePoint = true; continue; } if (option == null) throw new NullPointerException(); throw new UnsupportedOperationException(); } return flags; }
Example #12
Source File: WindowsChannelFactory.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 3 votes |
static Flags toFlags(Set<? extends OpenOption> options) { Flags flags = new Flags(); for (OpenOption option: options) { if (option instanceof StandardOpenOption) { switch ((StandardOpenOption)option) { case READ : flags.read = true; break; case WRITE : flags.write = true; break; case APPEND : flags.append = true; break; case TRUNCATE_EXISTING : flags.truncateExisting = true; break; case CREATE : flags.create = true; break; case CREATE_NEW : flags.createNew = true; break; case DELETE_ON_CLOSE : flags.deleteOnClose = true; break; case SPARSE : flags.sparse = true; break; case SYNC : flags.sync = true; break; case DSYNC : flags.dsync = true; break; default: throw new UnsupportedOperationException(); } continue; } if (option instanceof ExtendedOpenOption) { switch ((ExtendedOpenOption)option) { case NOSHARE_READ : flags.shareRead = false; break; case NOSHARE_WRITE : flags.shareWrite = false; break; case NOSHARE_DELETE : flags.shareDelete = false; break; default: throw new UnsupportedOperationException(); } continue; } if (option == LinkOption.NOFOLLOW_LINKS) { flags.noFollowLinks = true; continue; } if (option == OPEN_REPARSE_POINT) { flags.openReparsePoint = true; continue; } if (option == null) throw new NullPointerException(); throw new UnsupportedOperationException(); } return flags; }
Example #13
Source File: WindowsChannelFactory.java From jdk8u-jdk with GNU General Public License v2.0 | 3 votes |
static Flags toFlags(Set<? extends OpenOption> options) { Flags flags = new Flags(); for (OpenOption option: options) { if (option instanceof StandardOpenOption) { switch ((StandardOpenOption)option) { case READ : flags.read = true; break; case WRITE : flags.write = true; break; case APPEND : flags.append = true; break; case TRUNCATE_EXISTING : flags.truncateExisting = true; break; case CREATE : flags.create = true; break; case CREATE_NEW : flags.createNew = true; break; case DELETE_ON_CLOSE : flags.deleteOnClose = true; break; case SPARSE : flags.sparse = true; break; case SYNC : flags.sync = true; break; case DSYNC : flags.dsync = true; break; default: throw new UnsupportedOperationException(); } continue; } if (option instanceof ExtendedOpenOption) { switch ((ExtendedOpenOption)option) { case NOSHARE_READ : flags.shareRead = false; break; case NOSHARE_WRITE : flags.shareWrite = false; break; case NOSHARE_DELETE : flags.shareDelete = false; break; default: throw new UnsupportedOperationException(); } continue; } if (option == LinkOption.NOFOLLOW_LINKS) { flags.noFollowLinks = true; continue; } if (option == OPEN_REPARSE_POINT) { flags.openReparsePoint = true; continue; } if (option == null) throw new NullPointerException(); throw new UnsupportedOperationException(); } return flags; }