src/share/classes/java/nio/channels/FileChannel.java

Print this page

        

@@ -246,11 +246,11 @@
      *
      * <p> The new channel is created by invoking the {@link
      * FileSystemProvider#newFileChannel newFileChannel} method on the
      * provider that created the {@code Path}.
      *
-     * @param   file
+     * @param   path
      *          The path of the file to open or create
      * @param   options
      *          Options specifying how the file is opened
      * @param   attrs
      *          An optional list of file attributes to set atomically when

@@ -259,11 +259,11 @@
      * @return  A new file channel
      *
      * @throws  IllegalArgumentException
      *          If the set contains an invalid combination of options
      * @throws  UnsupportedOperationException
-     *          If the {@code file} is associated with a provider that does not
+     *          If the {@code path} is associated with a provider that does not
      *          support creating file channels, or an unsupported open option is
      *          specified, or the array contains an attribute that cannot be set
      *          atomically when creating the file
      * @throws  IOException
      *          If an I/O error occurs

@@ -276,17 +276,17 @@
      *          SecurityManager#checkWrite(String)} method is invoked to check
      *          write access if the file is opened for writing
      *
      * @since   1.7
      */
-    public static FileChannel open(Path file,
+    public static FileChannel open(Path path,
                                    Set<? extends OpenOption> options,
                                    FileAttribute<?>... attrs)
         throws IOException
     {
-        FileSystemProvider provider = file.getFileSystem().provider();
-        return provider.newFileChannel(file, options, attrs);
+        FileSystemProvider provider = path.getFileSystem().provider();
+        return provider.newFileChannel(path, options, attrs);
     }
 
     private static final FileAttribute<?>[] NO_ATTRIBUTES = new FileAttribute[0];
 
     /**

@@ -293,24 +293,26 @@
      * Opens or creates a file, returning a file channel to access the file.
      *
      * <p> An invocation of this method behaves in exactly the same way as the
      * invocation
      * <pre>
-     *     fc.{@link #open(Path,Set,FileAttribute[]) open}(file, options, new FileAttribute&lt;?&gt;[0]);
+     *     fc.{@link #open(Path,Set,FileAttribute[]) open}(file, opts, new FileAttribute&lt;?&gt;[0]);
      * </pre>
+     * where {@code opts} is a set of the options specified in the {@code
+     * options} array.
      *
-     * @param   file
+     * @param   path
      *          The path of the file to open or create
      * @param   options
      *          Options specifying how the file is opened
      *
      * @return  A new file channel
      *
      * @throws  IllegalArgumentException
      *          If the set contains an invalid combination of options
      * @throws  UnsupportedOperationException
-     *          If the {@code file} is associated with a provider that does not
+     *          If the {@code path} is associated with a provider that does not
      *          support creating file channels, or an unsupported open option is
      *          specified
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException

@@ -322,16 +324,16 @@
      *          SecurityManager#checkWrite(String)} method is invoked to check
      *          write access if the file is opened for writing
      *
      * @since   1.7
      */
-    public static FileChannel open(Path file, OpenOption... options)
+    public static FileChannel open(Path path, OpenOption... options)
         throws IOException
     {
         Set<OpenOption> set = new HashSet<OpenOption>(options.length);
         Collections.addAll(set, options);
-        return open(file, set, NO_ATTRIBUTES);
+        return open(path, set, NO_ATTRIBUTES);
     }
 
     // -- Channel operations --
 
     /**