< prev index next >
src/java.base/unix/classes/sun/nio/fs/UnixChannelFactory.java
Print this page
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2008, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2008, 2017, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
@@ -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,12 @@
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 >