< prev index next >
src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java
Print this page
@@ -62,10 +62,11 @@
boolean create;
boolean createNew;
boolean deleteOnClose;
boolean sync;
boolean dsync;
+ boolean direct;
static Flags toFlags(Set<? extends OpenOption> options) {
Flags flags = new Flags();
for (OpenOption option: options) {
if (option instanceof StandardOpenOption) {
@@ -86,10 +87,16 @@
}
if (option == LinkOption.NOFOLLOW_LINKS && O_NOFOLLOW != 0) {
flags.noFollowLinks = true;
continue;
}
+
+ if (ExtendedOptions.DIRECT.matches(option)) {
+ flags.direct = true;
+ continue;
+ }
+
if (option == null)
throw new NullPointerException();
throw new UnsupportedOperationException(option + " not supported");
}
return flags;
@@ -132,11 +139,11 @@
throw new IllegalArgumentException("READ + APPEND not allowed");
if (flags.append && flags.truncateExisting)
throw new IllegalArgumentException("APPEND + TRUNCATE_EXISTING not allowed");
FileDescriptor fdObj = open(dfd, path, pathForPermissionCheck, flags, mode);
- return FileChannelImpl.open(fdObj, path.toString(), flags.read, flags.write, null);
+ return FileChannelImpl.open(fdObj, path.toString(), flags.read, flags.write, flags.direct, null);
}
/**
* Constructs a file channel by opening the given file.
*/
< prev index next >