changeset 421:f20b932c2da0

File system API updates for nio2-b93: - Move Path.get(String) and get(URI) methods to new Paths factory class - Remove AttributeView bind methods (requires renaming newFileAttributeView method to getFileAttributeView) - Obtain UserPrincipalLookupService from FileSystem rather than AttributeView
author alanb
date Tue, 22 Jul 2008 11:58:11 +0100
parents 16ff323ef46a
children 7c735eade49f
files make/java/nio/FILES_java.gmk src/share/classes/java/io/File.java src/share/classes/java/nio/file/FileRef.java src/share/classes/java/nio/file/FileStore.java src/share/classes/java/nio/file/FileSystem.java src/share/classes/java/nio/file/Path.java src/share/classes/java/nio/file/Paths.java src/share/classes/java/nio/file/SecureDirectoryStream.java src/share/classes/java/nio/file/attribute/AclFileAttributeView.java src/share/classes/java/nio/file/attribute/AttributeView.java src/share/classes/java/nio/file/attribute/Attributes.java src/share/classes/java/nio/file/attribute/BasicFileAttributeView.java src/share/classes/java/nio/file/attribute/DosFileAttributeView.java src/share/classes/java/nio/file/attribute/FileAttributeView.java src/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java src/share/classes/java/nio/file/attribute/FileStoreAttributeView.java src/share/classes/java/nio/file/attribute/FileStoreSpaceAttributeView.java src/share/classes/java/nio/file/attribute/NamedAttributeView.java src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java src/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java src/share/classes/java/nio/file/attribute/package-info.java src/share/classes/java/nio/file/spi/AbstractPath.java src/share/classes/sun/nio/fs/AbstractNamedAttributeView.java src/share/classes/sun/nio/fs/FileInfo.java src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/JarFileAttributeView.java src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFileAttributeView.java src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFileBasicAttributeView.java src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFilePath.java src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFileStore.java src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFileSystem.java src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFileSystemProvider.java src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipPathParser.java src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipUtils.java src/share/sample/nio/file/AclEdit.java src/share/sample/nio/file/Copy.java src/share/sample/nio/file/DiskUsage.java src/share/sample/nio/file/FileType.java src/share/sample/nio/file/WatchDir.java src/share/sample/nio/file/Xdd.java src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java src/solaris/classes/sun/nio/fs/LinuxFileSystem.java src/solaris/classes/sun/nio/fs/LinuxNamedAttributeView.java src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java src/solaris/classes/sun/nio/fs/SolarisFileSystem.java src/solaris/classes/sun/nio/fs/SolarisNamedAttributeView.java src/solaris/classes/sun/nio/fs/UnixFileAttributeView.java src/solaris/classes/sun/nio/fs/UnixFileStore.java src/solaris/classes/sun/nio/fs/UnixFileSystem.java src/solaris/classes/sun/nio/fs/UnixPath.java src/solaris/classes/sun/nio/fs/UnixSecureDirectoryStream.java src/solaris/classes/sun/nio/fs/UnixUserPrincipal.java src/windows/classes/sun/nio/fs/WindowsAclFileAttributeView.java src/windows/classes/sun/nio/fs/WindowsFileAttributeView.java src/windows/classes/sun/nio/fs/WindowsFileCopy.java src/windows/classes/sun/nio/fs/WindowsFileStore.java src/windows/classes/sun/nio/fs/WindowsFileSystem.java src/windows/classes/sun/nio/fs/WindowsNamedAttributeView.java src/windows/classes/sun/nio/fs/WindowsPath.java src/windows/classes/sun/nio/fs/WindowsSecurity.java test/demo/nio/ZipFileSystem/Sanity.java test/java/nio/channels/AsynchronousFileChannel/Lock.java test/java/nio/channels/AsynchronousServerSocketChannel/WithSecurityManager.java test/java/nio/file/DirectoryStream/Basic.java test/java/nio/file/DirectoryStream/SecureDS.java test/java/nio/file/FileStore/Basic.java test/java/nio/file/Files/ForceLoad.java test/java/nio/file/Path/CopyAndMove.java test/java/nio/file/Path/Links.java test/java/nio/file/Path/Misc.java test/java/nio/file/Path/UriImportExport.java test/java/nio/file/TestUtil.java test/java/nio/file/attribute/AclFileAttributeView/Basic.java test/java/nio/file/attribute/BasicFileAttributeView/Basic.java test/java/nio/file/attribute/DosFileAttributeView/Basic.java test/java/nio/file/attribute/FileStoreSpaceAttributeView/Basic.java test/java/nio/file/attribute/NamedAttributeView/Basic.java test/java/nio/file/attribute/PosixFileAttributeView/Basic.java test/java/nio/file/spi/TestProvider.java
diffstat 78 files changed, 696 insertions(+), 1301 deletions(-) [+]
line wrap: on
line diff
--- a/make/java/nio/FILES_java.gmk	Tue Jul 22 10:22:21 2008 +0100
+++ b/make/java/nio/FILES_java.gmk	Tue Jul 22 11:58:11 2008 +0100
@@ -109,6 +109,7 @@
 	java/nio/file/NotLinkException.java \
 	java/nio/file/OpenOption.java \
 	java/nio/file/Path.java \
+	java/nio/file/Paths.java \
 	java/nio/file/ProviderMismatchException.java \
 	java/nio/file/ProviderNotFoundException.java \
 	java/nio/file/ReadOnlyFileSystemException.java \
@@ -239,7 +240,6 @@
 	sun/nio/fs/AbstractWatchKey.java \
 	sun/nio/fs/AbstractWatchService.java \
 	sun/nio/fs/DefaultFileSystemProvider.java \
-	sun/nio/fs/FileInfo.java \
 	sun/nio/fs/Globs.java \
 	sun/nio/fs/NativeBuffer.java \
 	sun/nio/fs/NativeBuffers.java \
--- a/src/share/classes/java/io/File.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/io/File.java	Tue Jul 22 11:58:11 2008 +0100
@@ -2005,8 +2005,12 @@
         if (filePath == null) {
             synchronized (this) {
                 if (filePath == null) {
-                    filePath = (path.length() == 0) ?
-                        Path.get(".") : Path.get(path);
+                    if (path.length() == 0) {
+                        // assume default file system treats "." as current directory
+                        filePath = Paths.get(".");
+                    } else {
+                        filePath = Paths.get(path);
+                    }
                 }
             }
         }
--- a/src/share/classes/java/nio/file/FileRef.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/FileRef.java	Tue Jul 22 11:58:11 2008 +0100
@@ -38,7 +38,7 @@
  * In other cases it may be a file-system specific identifier.
  *
  * <p> This class defines methods to {@link #newSeekableByteChannel open} the
- * file for reading or writing, {@link #newFileAttributeView obtain} an object to
+ * file for reading or writing, {@link #getFileAttributeView obtain} an object to
  * access its file attributes or <i>meta-data</i>, or to {@link #delete delete}
  * the file. Where the file is a directory then the {@link #newDirectoryStream
  * newDirectoryStream} method is defined to iterate over the entries in the
@@ -268,7 +268,7 @@
     void checkAccess(Access requested) throws IOException;
 
     /**
-     * Returns a new file attribute view that is bound to this object.
+     * Returns a file attribute view of the specified type.
      *
      * <p> A file attribute view provides a read-only or updatable view of a
      * set of file attributes. The {@code type} parameter specifies the type of
@@ -286,13 +286,12 @@
      * @param   followLinks
      *          {@code true} if the links should be followed
      *
-     * @return  a new file attribute view of the specified type bound to
-     *          this {@code FileRef}, or {@code null} if the attribute view
-     *          type is not available
+     * @return  a file attribute view of the specified type, or {@code null} if
+     *          the attribute view type is not available
      *
      * @see Attributes#readBasicFileAttributes
      */
-    <V extends FileAttributeView> V newFileAttributeView(Class<V> type,
+    <V extends FileAttributeView> V getFileAttributeView(Class<V> type,
                                                          boolean followLinks);
 
     /**
--- a/src/share/classes/java/nio/file/FileStore.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/FileStore.java	Tue Jul 22 11:58:11 2008 +0100
@@ -38,7 +38,7 @@
  * <p> In addition to the methods defined by this class, a file store may support
  * one or more {@link FileStoreAttributeView FileStoreAttributeView} classes
  * that provide a read-only or updatable view of a set of file store attributes.
- * The {@link #newFileStoreAttributeView newFileStoreAttributeView} method is
+ * The {@link #getFileStoreAttributeView getFileStoreAttributeView} method is
  * used to obtain a file store attribute view, and the {@link
  * #getFileStoreAttributeViews getFileStoreAttributeViews} method
  * can be used to iterate over the attribute views supported by the file store.
@@ -127,9 +127,7 @@
         getFileStoreAttributeViews();
 
     /**
-     * Creates a new {@link FileStoreAttributeView} of the specified type
-     * that is bound to this file store. This method returns {@code null} if the
-     * attribute view of the specific type is not present.
+     * Returns a {@link FileStoreAttributeView} of the specified type.
      *
      * <p> For {@code FileStore} objects created by the default provider, then
      * the file stores support the {@link FileStoreSpaceAttributeView} that provides
@@ -140,9 +138,9 @@
      * @param   viewType
      *          The {@code Class} object corresponding to the file attribute view
      *
-     * @return  A new file store attribute view of the specified type
+     * @return  A file store attribute view of the specified type
      *          that is bound to this file store, or <tt>null</tt>.
      */
     public abstract <V extends FileStoreAttributeView> V
-        newFileStoreAttributeView(Class<V> viewType);
+        getFileStoreAttributeView(Class<V> viewType);
 }
--- a/src/share/classes/java/nio/file/FileSystem.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/FileSystem.java	Tue Jul 22 11:58:11 2008 +0100
@@ -52,6 +52,9 @@
  *   <li><p> The {@link #getFileStores getFileStores} method enumerates the
  *     underlying {@link FileStore file-stores}, returning an object to iterate
  *     over them.  </p></li>
+ *   <li><p> The {@link #getUserPrincipalLookupService getUserPrincipalLookupService}
+ *     method returns the {@link UserPrincipalLookupService} to lookup users or
+ *     groups by name. </p></li>
  *   <li><p> The {@link #newWatchService newWatchService} method creates a
  *     {@link WatchService} that may be used to watch objects for changes and
  *     events. </p></li>
@@ -222,32 +225,10 @@
      *
      * @return  An object to iterate over the file attribute view supported by
      *          this file store
-     *
-     * @see #newFileAttributeView
      */
     public abstract Iterable<Class<? extends FileAttributeView>> getFileAttributeViews();
 
     /**
-     * Return a new, and {@link FileAttributeView#bind unbound}, file
-     * attribute view. A file attribute view provides a read-only or updatable
-     * view of a set of related file attributes. The {@code type} parameter
-     * specifies the type of the attribute view and the method returns an
-     * instance of that type if supported. The {@link BasicFileAttributeView}
-     * type supports access to the basic attributes of a file. Invoking this
-     * method to request a file attribute view of that type will always return
-     * an instance of that class.
-     *
-     * @param   viewType
-     *          The {@code Class} object corresponding to the file attribute view
-     *
-     * @return  A new, and unbound, file attribute view of the specified
-     *          type, or {@code null}
-     *
-     * @see #getFileAttributeViews
-     */
-    public abstract <V extends FileAttributeView> V newFileAttributeView(Class<V> viewType);
-
-    /**
      * Converts a path string to a {@code Path}.
      *
      * <p> The parsing and conversion to a path object is inherently
@@ -389,6 +370,17 @@
     public abstract NameMatcher getNameMatcher(String syntaxAndPattern);
 
     /**
+     * Returns the {@code UserPrincipalLookupService} for this file system.
+     * The resulting lookup service may be used to lookup user or group names.
+     *
+     * @return  The {@code UserPrincipalLookupService} for this file system,
+     *          or {@code null} if the file system does not have a lookup service
+     *
+     * @see Attributes#setOwner
+     */
+    public abstract UserPrincipalLookupService getUserPrincipalLookupService();
+
+    /**
      * Constructs a new {@link WatchService} <i>(optional operation)</i>.
      *
      * <p> This method constructs a new watch service that may be used to watch
--- a/src/share/classes/java/nio/file/Path.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/Path.java	Tue Jul 22 11:58:11 2008 +0100
@@ -130,90 +130,6 @@
     public abstract FileSystem getFileSystem();
 
     /**
-     * Constructs a {@code Path} by converting the given path string.
-     *
-     * <p> The {@code Path} is obtained by invoking the {@link FileSystem#getPath
-     * getPath} method of the {@link FileSystems#getDefault default} {@link
-     * FileSystem}.
-     *
-     * @param   path
-     *          The path string to convert
-     *
-     * @return  The resulting {@code Path}
-     *
-     * @throws  InvalidPathException
-     *          If the path string cannot be converted to a {@code Path}
-     *
-     * @see FileSystem#getPath
-     */
-    public static Path get(String path) {
-        return FileSystems.getDefault().getPath(path);
-    }
-
-    /**
-     * Converts the given URI to a {@link Path} object.
-     *
-     * <p> This method iterates over the {@link FileSystemProvider#installedProviders()
-     * installed} providers to locate the provider that is identified by the
-     * URI {@link URI#getScheme scheme} of the given URI. URI schemes are
-     * compared without regard to case. If the provider is found then its {@link
-     * FileSystemProvider#getPath getPath} method is invoked to convert the
-     * URI.
-     *
-     * <p> In the case of the default provider, identified by the URI scheme
-     * "file", the given URI has a non-empty path component, and undefined query
-     * and fragment components. Whether the authority component may be present
-     * is platform specific. The returned {@code Path} is associated with the
-     * {@link FileSystems#getDefault default} file system.
-     *
-     * <p> The default provider provides a similar <em>round-trip</em> guarantee
-     * to the {@link java.io.File} class. For a given {@code Path} <i>p</i> it
-     * is guaranteed that
-     * <blockquote><tt>
-     * Path.get(</tt><i>p</i><tt>.{@link #toUri() toUri}()).equals(</tt>
-     * <i>p</i><tt>.{@link #toAbsolutePath() toAbsolutePath}())</tt>
-     * </blockquote>
-     * so long as the original {@code Path}, the {@code URI}, and the new {@code
-     * Path} are all created in (possibly different invocations of) the same
-     * Java virtual machine. Whether other providers make any guarantees is
-     * provider specific and therefore unspecified.
-     *
-     * @param   uri
-     *          The URI to convert
-     *
-     * @return  The resulting {@code Path}
-     *
-     * @throws  IllegalArgumentException
-     *          If preconditions on the {@code uri} parameter do not hold. The
-     *          format of the URI is provider specific.
-     * @throws  FileSystemNotFoundException
-     *          If the file system identified by the URI does not exist or the
-     *          provider identified by the URI's scheme component is not installed
-     * @throws  SecurityException
-     *          If a security manager is installed and it denies an unspecified
-     *          permission to access the file system
-     */
-    public static Path get(URI uri) {
-        String scheme =  uri.getScheme();
-        if (scheme == null)
-            throw new IllegalArgumentException("Missing scheme");
-
-        // check for default provider to avoid loading of installed providers
-        if (scheme.equalsIgnoreCase("file"))
-            return FileSystems.getDefault().provider().getPath(uri);
-
-        // try to find provider
-        for (FileSystemProvider provider: FileSystemProvider.installedProviders()) {
-            if (provider.getScheme().equalsIgnoreCase(scheme)) {
-                return provider.getPath(uri);
-            }
-        }
-
-        throw new FileSystemNotFoundException("Provider \"" + scheme + "\" not installed");
-    }
-
-
-    /**
      * Tells whether or not this path is absolute.
      *
      * <p> An absolute path is complete in that it doesn't need to be
@@ -622,7 +538,7 @@
      * to the {@link java.io.File} class. For a given {@code Path} <i>p</i> it
      * is guaranteed that
      * <blockquote><tt>
-     * Path.{@link Path#get(URI) get}(</tt><i>p</i><tt>.toUri()).equals(</tt><i>p</i>
+     * {@link Paths#get(URI) Paths.get}(</tt><i>p</i><tt>.toUri()).equals(</tt><i>p</i>
      * <tt>.{@link #toAbsolutePath() toAbsolutePath}())</tt>
      * </blockquote>
      * so long as the original {@code Path}, the {@code URI}, and the new {@code
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/share/classes/java/nio/file/Paths.java	Tue Jul 22 11:58:11 2008 +0100
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2007-2008 Sun Microsystems, Inc.  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.  Sun designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Sun in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ */
+
+package java.nio.file;
+
+import java.nio.file.spi.FileSystemProvider;
+import java.net.URI;
+
+/**
+ * Factory methods for paths.
+ *
+ * @since 1.7
+ */
+
+public class Paths {
+    private Paths() { }
+
+    /**
+     * Constructs a {@code Path} by converting the given path string.
+     *
+     * <p> The {@code Path} is obtained by invoking the {@link FileSystem#getPath
+     * getPath} method of the {@link FileSystems#getDefault default} {@link
+     * FileSystem}.
+     *
+     * @param   path
+     *          The path string to convert
+     *
+     * @return  The resulting {@code Path}
+     *
+     * @throws  InvalidPathException
+     *          If the path string cannot be converted to a {@code Path}
+     *
+     * @see FileSystem#getPath
+     */
+    public static Path get(String path) {
+        return FileSystems.getDefault().getPath(path);
+    }
+
+    /**
+     * Converts the given URI to a {@link Path} object.
+     *
+     * <p> This method iterates over the {@link FileSystemProvider#installedProviders()
+     * installed} providers to locate the provider that is identified by the
+     * URI {@link URI#getScheme scheme} of the given URI. URI schemes are
+     * compared without regard to case. If the provider is found then its {@link
+     * FileSystemProvider#getPath getPath} method is invoked to convert the
+     * URI.
+     *
+     * <p> In the case of the default provider, identified by the URI scheme
+     * "file", the given URI has a non-empty path component, and undefined query
+     * and fragment components. Whether the authority component may be present
+     * is platform specific. The returned {@code Path} is associated with the
+     * {@link FileSystems#getDefault default} file system.
+     *
+     * <p> The default provider provides a similar <em>round-trip</em> guarantee
+     * to the {@link java.io.File} class. For a given {@code Path} <i>p</i> it
+     * is guaranteed that
+     * <blockquote><tt>
+     * Paths.get(</tt><i>p</i><tt>.{@link Path#toUri() toUri}()).equals(</tt>
+     * <i>p</i><tt>.{@link Path#toAbsolutePath() toAbsolutePath}())</tt>
+     * </blockquote>
+     * so long as the original {@code Path}, the {@code URI}, and the new {@code
+     * Path} are all created in (possibly different invocations of) the same
+     * Java virtual machine. Whether other providers make any guarantees is
+     * provider specific and therefore unspecified.
+     *
+     * @param   uri
+     *          The URI to convert
+     *
+     * @return  The resulting {@code Path}
+     *
+     * @throws  IllegalArgumentException
+     *          If preconditions on the {@code uri} parameter do not hold. The
+     *          format of the URI is provider specific.
+     * @throws  FileSystemNotFoundException
+     *          If the file system identified by the URI does not exist or the
+     *          provider identified by the URI's scheme component is not installed
+     * @throws  SecurityException
+     *          If a security manager is installed and it denies an unspecified
+     *          permission to access the file system
+     */
+    public static Path get(URI uri) {
+        String scheme =  uri.getScheme();
+        if (scheme == null)
+            throw new IllegalArgumentException("Missing scheme");
+
+        // check for default provider to avoid loading of installed providers
+        if (scheme.equalsIgnoreCase("file"))
+            return FileSystems.getDefault().provider().getPath(uri);
+
+        // try to find provider
+        for (FileSystemProvider provider: FileSystemProvider.installedProviders()) {
+            if (provider.getScheme().equalsIgnoreCase(scheme)) {
+                return provider.getPath(uri);
+            }
+        }
+
+        throw new FileSystemNotFoundException("Provider \"" + scheme + "\" not installed");
+    }
+}
--- a/src/share/classes/java/nio/file/SecureDirectoryStream.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/SecureDirectoryStream.java	Tue Jul 22 11:58:11 2008 +0100
@@ -262,7 +262,7 @@
      *          this directory stream, or {@code null} if the attribute view
      *          type is not available
      */
-    public abstract <V extends FileAttributeView> V newFileAttributeView(Class<V> type);
+    public abstract <V extends FileAttributeView> V getFileAttributeView(Class<V> type);
 
     /**
      * Returns a new file attribute view that is bound to a file in this
@@ -295,7 +295,7 @@
      *          type is not available
      *
      */
-    public abstract <V extends FileAttributeView> V newFileAttributeView(Path path,
+    public abstract <V extends FileAttributeView> V getFileAttributeView(Path path,
                                                                          Class<V> type,
                                                                          boolean followLinks);
 }
--- a/src/share/classes/java/nio/file/attribute/AclFileAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/attribute/AclFileAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -54,11 +54,6 @@
  * supportsFileAttributeView} method can be used to test if a file system
  * supports ACLs.
  *
- * <p> This class implements the {@link UserPrincipalLookupService} interface
- * to allow for the lookup of user or group names. There is no guarantee that the
- * {@link UserPrincipal} objects returned from a lookup can be used by other
- * attribute view types.
- *
  * <a name="interop"><h4>Interoperability</h4></a>
  *
  * RFC&nbsp;3530 allows for special user identities to be used on platforms that
@@ -66,18 +61,22 @@
  * are "{@code OWNER@}", "{@code GROUP@}", and "{@code EVERYONE@}". When both
  * the {@code AclFileAttributeView} and the {@link PosixFileAttributeView}
  * are supported then these special user identities may be included in ACL {@link
- * AclEntry entries} that are read or written. The {@link #lookupPrincipalByName
- * lookupPrincipalByName} method can be used to obtain a {@link UserPrincipal}
- * to represent these special identities.
+ * AclEntry entries} that are read or written. The file system's {@link
+ * UserPrincipalLookupService} ma an be used to obtain a {@link UserPrincipal}
+ * to represent these special identities by invoking the {@link
+ * UserPrincipalLookupService#lookupPrincipalByName lookupPrincipalByName}
+ * method.
  *
  * <p> <b>Usage Example:</b>
  * Suppose we wish to add an entry to an existing ACL to grant "joe" access:
  * <pre>
+ *     // lookup "joe"
+ *     UserPrincipal joe = file.getFileSystem().getUserPrincipalLookupService()
+ *         .lookupPrincipalByName("joe");
+ *
+ *     // get view
  *     AclFileAttributeView view = file.newFileAttributeView(AclFileAttributeView.class, true);
  *
- *     // lookup "joe"
- *     UserPrincipal joe = view.lookupPrincipalByName("joe");
- *
  *     // create ACE to give "joe" read access
  *     AclEntry entry = AclEntry.newBuilder()
  *         .setType(AclEntryType.ALLOW)
@@ -97,14 +96,7 @@
 public interface AclFileAttributeView
     extends FileOwnerAttributeView
 {
-    @Override
-    AclFileAttributeView bind(FileRef obj);
-
-    @Override
-    AclFileAttributeView bind(FileRef obj, boolean followLinks);
-
     /**
-     * @throws  IllegalStateException                   {@inheritDoc}
      * @throws  IOException                             {@inheritDoc}
      * @throws  SecurityException                       {@inheritDoc}
      */
@@ -126,9 +118,6 @@
      * @return  An ordered list of {@link AclEntry entries} representing the
      *          ACL
      *
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound, or if bound to an object
-     *          that is not open for reading
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
@@ -167,9 +156,6 @@
      *
      * @return  This attribute view
      *
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound, or if bound to an object
-     *          that is not open for writing
      * @throws  IOException
      *          If an I/O error occurs or the ACL is invalid
      * @throws  SecurityException
@@ -195,6 +181,8 @@
      * attempt to create a file that would appear to make the file more secure
      * than than would be the case if the ACL were updated.
      *
+     * <p> {@note TDB: find a better place to define this method.}
+     *
      * @return  A new attribute object; its initial value is an empty list
      *
      * @throws  UnsupportedOperationException
--- a/src/share/classes/java/nio/file/attribute/AttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/attribute/AttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -29,34 +29,13 @@
  * An object that provides a read-only or updatable view of non-opaque values
  * associated with an object in a filesystem. This interface is extended or
  * implemented by specific attribute views that define the attributes supported
- * by the view. In order to read or update an attribute value the attribute view
- * must first be {@link #bind(Object) bound} to a file system object.
+ * by the view.
  *
  * <p> In addition to reading or updating attribute values, some attribute
- * views may define methods to aid in the construction of attribute values. In
- * such cases, the attribute view may not be required to be bound to an object
- * in the file system.
+ * views may define methods to aid in the construction of attribute values.
  *
  * @since 1.7
  */
 
-public interface AttributeView<T> {
-
-    /**
-     * Binds this attribute view to the given object.
-     *
-     * <p> An attribute view can only be bound to one object at a time;
-     * invoking this method causes any previous association to be discarded.
-     *
-     * @param   obj
-     *          The object to which attribute view should be bound, or
-     *          {@code null} to discard the current association
-     *
-     * @return  this attribute view
-     *
-     * @throws  java.nio.file.ProviderMismatchException
-     *          If the object is associated with a provider that differs from
-     *          the provider associated this attribute view
-     */
-    AttributeView<T> bind(T obj);
+public interface AttributeView {
 }
--- a/src/share/classes/java/nio/file/attribute/Attributes.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/attribute/Attributes.java	Tue Jul 22 11:58:11 2008 +0100
@@ -71,7 +71,7 @@
                                                               boolean followLinks)
         throws IOException
     {
-        return file.newFileAttributeView(BasicFileAttributeView.class, followLinks)
+        return file.getFileAttributeView(BasicFileAttributeView.class, followLinks)
             .readAttributes();
     }
 
@@ -115,7 +115,7 @@
         throws IOException
     {
         PosixFileAttributeView view =
-            file.newFileAttributeView(PosixFileAttributeView.class, followLinks);
+            file.getFileAttributeView(PosixFileAttributeView.class, followLinks);
         if (view == null)
             throw new UnsupportedOperationException();
         return view.readAttributes();
@@ -157,7 +157,7 @@
         throws IOException
     {
         DosFileAttributeView view =
-            file.newFileAttributeView(DosFileAttributeView.class, followLinks);
+            file.getFileAttributeView(DosFileAttributeView.class, followLinks);
         if (view == null)
             throw new UnsupportedOperationException();
         return view.readAttributes();
@@ -189,7 +189,7 @@
      */
     public static UserPrincipal getOwner(FileRef file) throws IOException {
         FileOwnerAttributeView view =
-            file.newFileAttributeView(FileOwnerAttributeView.class, true);
+            file.getFileAttributeView(FileOwnerAttributeView.class, true);
         if (view == null)
             throw new UnsupportedOperationException();
         return view.getOwner();
@@ -221,7 +221,7 @@
             throws IOException
     {
         FileOwnerAttributeView view =
-            file.newFileAttributeView(FileOwnerAttributeView.class, true);
+            file.getFileAttributeView(FileOwnerAttributeView.class, true);
         if (view != null)
             view.setOwner(owner);
     }
@@ -261,7 +261,7 @@
                                            TimeUnit unit)
         throws IOException
     {
-        file.newFileAttributeView(BasicFileAttributeView.class, true)
+        file.getFileAttributeView(BasicFileAttributeView.class, true)
             .setTimes(lastModifiedTime, null, null, unit);
     }
 
@@ -300,7 +300,7 @@
                                          TimeUnit unit)
         throws IOException
     {
-        file.newFileAttributeView(BasicFileAttributeView.class, true)
+        file.getFileAttributeView(BasicFileAttributeView.class, true)
             .setTimes(null, lastAccessTime, null, unit);
     }
 
@@ -339,7 +339,7 @@
                                        TimeUnit unit)
         throws IOException
     {
-        file.newFileAttributeView(BasicFileAttributeView.class, true)
+        file.getFileAttributeView(BasicFileAttributeView.class, true)
             .setTimes(null, null, createTime, unit);
     }
 
@@ -374,7 +374,7 @@
         throws IOException
     {
         PosixFileAttributeView view =
-            file.newFileAttributeView(PosixFileAttributeView.class, true);
+            file.getFileAttributeView(PosixFileAttributeView.class, true);
         if (view != null)
             view.setPermissions(perms);
     }
@@ -407,7 +407,7 @@
         throws IOException
     {
         PosixFileAttributeView view =
-            file.newFileAttributeView(PosixFileAttributeView.class, true);
+            file.getFileAttributeView(PosixFileAttributeView.class, true);
         if (view != null) {
             Set<PosixFilePermission> set =
                 new HashSet<PosixFilePermission>(perms.length);
@@ -445,7 +445,7 @@
         throws IOException
     {
         FileStoreSpaceAttributeView view =
-            fs.newFileStoreAttributeView(FileStoreSpaceAttributeView.class);
+            fs.getFileStoreAttributeView(FileStoreSpaceAttributeView.class);
         if (view == null)
             throw new UnsupportedOperationException();
         return view.readAttributes();
--- a/src/share/classes/java/nio/file/attribute/BasicFileAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/attribute/BasicFileAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -25,7 +25,6 @@
 
 package java.nio.file.attribute;
 
-import java.nio.file.FileRef;
 import java.util.concurrent.TimeUnit;
 import java.io.IOException;
 
@@ -46,12 +45,6 @@
 public interface BasicFileAttributeView
     extends FileAttributeView
 {
-    @Override
-    BasicFileAttributeView bind(FileRef file);
-
-    @Override
-    BasicFileAttributeView bind(FileRef file, boolean followLinks);
-
     /**
      * Reads the file attributes as a bulk operation.
      *
@@ -60,9 +53,6 @@
      *
      * @return  The file attributes
      *
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound, or if bound to an object
-     *          that is not open for reading
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
@@ -113,9 +103,6 @@
      * @throws  IllegalArgumentException
      *          If any of the parameters is a negative value other than {@code
      *          -1L}
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound, or if bound to an object
-     *          that is not open for writing
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
--- a/src/share/classes/java/nio/file/attribute/DosFileAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/attribute/DosFileAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -44,14 +44,7 @@
 public interface DosFileAttributeView
     extends BasicFileAttributeView
 {
-    @Override
-    DosFileAttributeView bind(FileRef file);
-
-    @Override
-    DosFileAttributeView bind(FileRef file, boolean followLinks);
-
     /**
-     * @throws  IllegalStateException                   {@inheritDoc}
      * @throws  IOException                             {@inheritDoc}
      * @throws  SecurityException                       {@inheritDoc}
      */
@@ -60,7 +53,6 @@
         throws IOException;
 
     /**
-     * @throws  IllegalStateException                   {@inheritDoc}
      * @throws  IOException                             {@inheritDoc}
      * @throws  SecurityException                       {@inheritDoc}
      */
@@ -83,9 +75,6 @@
      *
      * @return  this attribute view
      *
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound, or if bound to an object
-     *          that is not open for writing
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
@@ -108,9 +97,6 @@
      *
      * @return  this attribute view
      *
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound, or if bound to an object
-     *          that is not open for writing
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
@@ -133,9 +119,6 @@
      *
      * @return  this attribute view
      *
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound, or if bound to an object
-     *          that is not open for writing
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
@@ -158,9 +141,6 @@
      *
      * @return  this attribute view
      *
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound, or if bound to an object
-     *          that is not open for writing
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
--- a/src/share/classes/java/nio/file/attribute/FileAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/attribute/FileAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -25,52 +25,14 @@
 
 package java.nio.file.attribute;
 
-import java.nio.file.FileRef;
-
 /**
  * An attribute view that is a read-only or updatable view of non-opaque
- * values associated with a file in a filesystem. This interface extends
- * {@link AttributeView} to define the {@link #bind(FileRef,boolean)
- * bind} method to allow the attribute view to be bound to a reference to a
- * file and specify if symbolic links should be followed or not.
+ * values associated with a file in a filesystem.
  *
  * @since 1.7
  */
 
 public interface FileAttributeView
-    extends AttributeView<FileRef>
+    extends AttributeView
 {
-    /**
-     * Binds this attribute view to the given file reference.
-     *
-     * <p> This method is equivalent to invoking the {@link #bind(FileRef,boolean)
-     * bind} method with the {@code followLinks} parameter set to a value of
-     * {@code true}.
-     *
-     * @param   file
-     *          The file to which attribute view should be bound, or
-     *          {@code null} to discard the current association
-     *
-     * @return  this attribute view
-     */
-    @Override
-    FileAttributeView bind(FileRef file);
-
-    /**
-     * Binds this attribute view to the given file reference. The {@code
-     * followLinks} parameter specifies if links should be followed or not.
-     * This parameter is ignored by implementations that do not support symbolic
-     * links. Where symbolic links are supported, and the value of parameter is
-     * {@code false}, then the attribute view provides access to the attributes
-     * of the symbolic link (if supported by the implementation).
-     *
-     * @param   file
-     *          The file to which attribute view should be bound, or
-     *          {@code null} to discard the current association
-     * @param   followLinks
-     *          {@code true} if links should be followed
-     *
-     * @return  this attribute view
-     */
-    FileAttributeView bind(FileRef file, boolean followLinks);
 }
--- a/src/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/attribute/FileOwnerAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -39,14 +39,8 @@
  */
 
 public interface FileOwnerAttributeView
-    extends FileAttributeView, UserPrincipalLookupService
+    extends FileAttributeView
 {
-    @Override
-    FileOwnerAttributeView bind(FileRef obj);
-
-    @Override
-    FileOwnerAttributeView bind(FileRef obj, boolean followLinks);
-
     /**
      * Read the file owner.
      *
@@ -55,9 +49,6 @@
      *
      * @return  the file owner
      *
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound, or if bound to an object
-     *          that is not open for reading
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
@@ -82,9 +73,6 @@
      *
      * @return  this attribute view
      *
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound, or if bound to an object
-     *          that is not open for writing
      * @throws  IOException
      *          If an I/O error occurs, or the {@code owner} parameter is a
      *          group and this implementation does not support setting the owner
--- a/src/share/classes/java/nio/file/attribute/FileStoreAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/attribute/FileStoreAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -25,18 +25,14 @@
 
 package java.nio.file.attribute;
 
-import java.nio.file.FileStore;
-
 /**
  * An attribute view that is a read-only or updatable view of the attributes of
- * a {@link FileStore}.
+ * a {@link java.nio.file.FileStore}.
  *
  * @since 1.7
  */
 
 public interface FileStoreAttributeView
-    extends AttributeView<FileStore>
+    extends AttributeView
 {
-    @Override
-    FileStoreAttributeView bind(FileStore obj);
 }
--- a/src/share/classes/java/nio/file/attribute/FileStoreSpaceAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/attribute/FileStoreSpaceAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -37,9 +37,6 @@
 public interface FileStoreSpaceAttributeView
     extends FileStoreAttributeView
 {
-    @Override
-    FileStoreSpaceAttributeView bind(FileStore fs);
-
     /**
      * Reads the disk space attributes as a bulk operation.
      *
@@ -48,8 +45,6 @@
      *
      * @return  The disk space attributes
      *
-     * @throws  IllegalStateException
-     *          If this attribute view is not bound
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
--- a/src/share/classes/java/nio/file/attribute/NamedAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/attribute/NamedAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -64,12 +64,6 @@
 public interface NamedAttributeView
     extends FileAttributeView
 {
-    @Override
-    NamedAttributeView bind(FileRef file);
-
-    @Override
-    NamedAttributeView bind(FileRef file, boolean followLinks);
-
     /**
      * Returns an object to iterate over the names of the file's named
      * attributes. The ordering that the names are returned is not specified.
@@ -83,8 +77,6 @@
      * @return  An object to iterate over the names of the file's named
      *          attributes
      *
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
@@ -106,8 +98,6 @@
      *
      * @throws  ArithmeticException
      *          If the size of the attribute is larger than {@link Integer#MAX_VALUE}
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
@@ -140,8 +130,6 @@
      *
      * @throws  IllegalArgumentException
      *          If the destination buffer is read-only
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
@@ -184,8 +172,6 @@
      *
      * @return  The number of bytes written, possibly zero
      *
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
@@ -205,8 +191,6 @@
      *
      * @return  This file attribute view
      *
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound
      * @throws  IOException
      *          If an I/O error occurs or the attribute does not exist
      * @throws  SecurityException
--- a/src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/attribute/PosixFileAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -59,9 +59,6 @@
  * operating systems and file systems may provide additional permission bits
  * but access to these other bits is not defined by this class in this release.
  *
- * <p> This interface extends {@link UserPrincipalLookupService} to allow for
- * the lookup of user or group names.
- *
  * <p> <b>Usage Example:</b>
  * Suppose we need to print out the owner and access permissions of a file:
  * <pre>
@@ -92,16 +89,9 @@
  */
 
 public interface PosixFileAttributeView
-    extends BasicFileAttributeView, UserPrincipalLookupService
+    extends BasicFileAttributeView
 {
-    @Override
-    PosixFileAttributeView bind(FileRef file);
-
-    @Override
-    PosixFileAttributeView bind(FileRef file, boolean followLinks);
-
     /**
-     * @throws  IllegalStateException      {@inheritDoc}
      * @throws  IOException                {@inheritDoc}
      * @throws  SecurityException
      *          In the case of the default provider, a security manager is
@@ -132,6 +122,8 @@
      * {@link java.nio.file.Path#createDirectory createDirectory} methods. In
      * other words, the file may be more secure than requested.
      *
+     * <p> {@note TDB: find a better place to define this method.}
+     *
      * @return  A new attribute object; its initial value is an empty set
      *
      * @throws  UnsupportedOperationException
@@ -142,7 +134,6 @@
     Attribute<Set<PosixFilePermission>> newPermissionsAttribute();
 
     /**
-     * @throws  IllegalStateException                   {@inheritDoc}
      * @throws  IOException                             {@inheritDoc}
      * @throws  SecurityException                       {@inheritDoc}
      */
@@ -163,9 +154,6 @@
      * @throws  ClassCastException
      *          If the sets contains elements that are not of type {@code
      *          PosixFilePermission}
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound, or if bound to an object
-     *          that is not open for writing
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
@@ -191,9 +179,6 @@
      *
      * @throws  IllegalArgumentException
      *          If the pre-conditions for the {@code owner} parameter is not met
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound, or if bound to an object
-     *          that is not open for writing
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
@@ -218,9 +203,6 @@
      *
      * @throws  IllegalArgumentException
      *          If the pre-conditions for the {@code group} parameter is not met
-     * @throws  IllegalStateException
-     *          If the attribute view is not bound, or if bound to an object
-     *          that is not open for writing
      * @throws  IOException
      *          If an I/O error occurs
      * @throws  SecurityException
--- a/src/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/attribute/UserPrincipalLookupService.java	Tue Jul 22 11:58:11 2008 +0100
@@ -46,6 +46,8 @@
  * if the namespaces are distinct.
  *
  * @since 1.7
+ *
+ * @see java.nio.file.FileSystem#getUserPrincipalLookupService
  */
 
 public interface UserPrincipalLookupService {
--- a/src/share/classes/java/nio/file/attribute/package-info.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/attribute/package-info.java	Tue Jul 22 11:58:11 2008 +0100
@@ -56,12 +56,12 @@
  * The {@link java.nio.file.attribute.FileAttributeView} interface is
  * extended by several other interfaces that that views to specific sets of file
  * attributes. {@code FileAttributeViews} are selected by invoking the {@link
- * java.nio.file.FileRef#newFileAttributeView} method with a
+ * java.nio.file.FileRef#getFileAttributeView} method with a
  * <em>type-token</em> to identify the required view. The {@link
  * java.nio.file.attribute.FileStoreAttributeView} interface provides
  * access to file system attributes. A {@code FileStoreAttributeView} of a given
  * type is obtained by invoking the {@link
- * java.nio.file.FileStore#newFileStoreAttributeView} method.
+ * java.nio.file.FileStore#getFileStoreAttributeView} method.
  *
  * <p> The {@link java.nio.file.attribute.BasicFileAttributeView}
  * class defines methods to read and update a <em>basic</em> set of file
--- a/src/share/classes/java/nio/file/spi/AbstractPath.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/java/nio/file/spi/AbstractPath.java	Tue Jul 22 11:58:11 2008 +0100
@@ -443,7 +443,7 @@
         // copy basic attributes to target
         if (opts.copyAttributes) {
             BasicFileAttributeView view = target
-                .newFileAttributeView(BasicFileAttributeView.class, opts.followLinks);
+                .getFileAttributeView(BasicFileAttributeView.class, opts.followLinks);
             try {
                 view.setTimes(attrs.lastModifiedTime(),
                               attrs.lastAccessTime(),
--- a/src/share/classes/sun/nio/fs/AbstractNamedAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/classes/sun/nio/fs/AbstractNamedAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -37,19 +37,7 @@
 abstract class AbstractNamedAttributeView
     implements NamedAttributeView
 {
-    // encapsulates the object that we are bound too
-    private volatile FileInfo fileInfo;
-
-    protected FileInfo getFileInfo() {
-        FileInfo res = fileInfo;
-        if (res == null)
-            throw new IllegalStateException();
-        return fileInfo;
-    }
-
-    protected void setFileInfo(FileRef file, boolean followLinks) {
-        fileInfo = (file == null) ? null : new FileInfo(file, followLinks);
-    }
+    protected AbstractNamedAttributeView() { }
 
     protected void checkAccess(String file,
                                boolean checkRead,
@@ -66,18 +54,11 @@
         }
     }
 
-    @Override
-    public final NamedAttributeView bind(FileRef obj) {
-        return bind(obj, true);
-    }
-
     /**
      * Returns an Iterator for the list with a remove implementation that
      * attempts to delete the last named attribute returned.
      */
-    protected Iterator<String> newIterator(final FileInfo info,
-                                           final List<String> list)
-    {
+    protected Iterator<String> newIterator(final List<String> list) {
         return new Iterator<String>() {
             private int pos = 0;
             private String last = null;
@@ -107,7 +88,7 @@
                 }
                 Throwable t = null;
                 try {
-                    implDelete(info, name);
+                    delete(name);
                 } catch (IOException x) {
                     t = x;
                 } catch (SecurityException x) {
@@ -123,17 +104,4 @@
             }
         };
     }
-
-    /**
-     * Deletes named attribute of the given file.
-     */
-    abstract void implDelete(FileInfo info, String name)
-        throws IOException;
-
-    @Override
-    public final NamedAttributeView delete(String name) throws IOException {
-        FileInfo info = getFileInfo();
-        implDelete(info, name);
-        return this;
-    }
 }
--- a/src/share/classes/sun/nio/fs/FileInfo.java	Tue Jul 22 10:22:21 2008 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,50 +0,0 @@
-/*
- * Copyright 2007-2008 Sun Microsystems, Inc.  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.  Sun designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Sun in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
- */
-
-package sun.nio.fs;
-
-import java.nio.file.FileRef;
-
-/**
- * Container class used by file attribute view implementations to encapsulate
- * the information about the file that they are bound.
- */
-
-class FileInfo {
-    private final FileRef file;
-    private final boolean followLinks;
-
-    FileInfo(FileRef file, boolean followLinks) {
-        this.file = file;
-        this.followLinks = followLinks;
-    }
-
-    FileRef file() {
-        return file;
-    }
-    boolean followLinks() {
-        return followLinks;
-    }
-}
--- a/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/JarFileAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/JarFileAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -40,7 +40,8 @@
         ZipFileBasicAttributeView {
 
     /** Creates a new instance of ZipFileAttributeView */
-    public JarFileAttributeView() {
+    public JarFileAttributeView(FileRef file) {
+        super(file);
     }
 
     @Override
--- a/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFileAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFileAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -41,7 +41,8 @@
         ZipFileBasicAttributeView {
 
     /** Creates a new instance of ZipFileAttributeView */
-    public ZipFileAttributeView() {
+    public ZipFileAttributeView(FileRef file) {
+        super(file);
     }
 
     @Override
--- a/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFileBasicAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFileBasicAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -40,10 +40,11 @@
 public class ZipFileBasicAttributeView implements
         BasicFileAttributeView {
     // encapsulates the object that we are bound too
-    private volatile FileRef binding;
+    private final FileRef binding;
 
     /** Creates a new instance of ZipFileAttributeView */
-    public ZipFileBasicAttributeView() {
+    public ZipFileBasicAttributeView(FileRef file) {
+        this.binding = file;
     }
 
     FileRef getBinding() {
@@ -52,16 +53,6 @@
         return b;
     }
 
-    public BasicFileAttributeView bind(FileRef f) {
-        this.binding = f;
-        return this;
-    }
-
-    public BasicFileAttributeView bind(FileRef f, boolean followLinks) {
-        bind(f);
-        return this;
-    }
-
     public BasicFileAttributes readAttributes()
             throws IOException {
         return new ZipFileBasicAttributes(getBinding());
--- a/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFilePath.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFilePath.java	Tue Jul 22 11:58:11 2008 +0100
@@ -780,18 +780,16 @@
 
     @Override
     @SuppressWarnings("unchecked")
-    public <V extends FileAttributeView> V newFileAttributeView(Class<V> type, boolean followLinks) {
-        FileAttributeView result = fileSystem.newFileAttributeView(type);
-        if (result == null) {
-            return null;
-        }
-
-        try {
-            return (V) result.bind(this, followLinks);
-        } catch (UnsupportedOperationException x) {
-            assert !followLinks;
-            return null;
-        }
+    public <V extends FileAttributeView> V getFileAttributeView(Class<V> type, boolean followLinks) {
+        if (type == null)
+            throw new NullPointerException();
+        if (type == BasicFileAttributeView.class)
+            return (V) new ZipFileBasicAttributeView(this);
+        if (type == ZipFileAttributeView.class)
+            return (V) new ZipFileAttributeView(this);
+        if (type == JarFileAttributeView.class)
+            return (V) new JarFileAttributeView(this);
+        return null;
     }
 
     @Override
@@ -917,7 +915,7 @@
                 }
 
                 InputStream in = zfile.getInputStream(entry);
-                Path pathtoZip = Path.get(ZipUtils.readFileInZip(in));
+                Path pathtoZip = Paths.get(ZipUtils.readFileInZip(in));
                 zfile.close();
                 SeekableByteChannel sbc = FileChannel.open(pathtoZip, options);
                 fileSystem.addCloseableObjects(sbc);
--- a/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFileStore.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFileStore.java	Tue Jul 22 11:58:11 2008 +0100
@@ -92,29 +92,22 @@
 
     @Override
     @SuppressWarnings("unchecked")
-    public <V extends FileStoreAttributeView> V newFileStoreAttributeView(Class<V> viewType) {
+    public <V extends FileStoreAttributeView> V getFileStoreAttributeView(Class<V> viewType) {
         if (viewType == FileStoreSpaceAttributeView.class) {
-            return (V) new ZipFileStoreAttributeView().bind(this);
+            return (V) new ZipFileStoreAttributeView(this);
         }
         return null;
     }
 
     private static class ZipFileStoreAttributeView implements FileStoreSpaceAttributeView {
 
-        ZipFileStore fileStore;
+        private final ZipFileStore fileStore;
 
-        public FileStoreSpaceAttributeView bind(FileStore fs) {
-            if (fs != null && !(fs instanceof ZipFileStore)) {
-                throw new ProviderMismatchException();
-            }
-            fileStore = (ZipFileStore) fs;
-            return this;
+        public ZipFileStoreAttributeView(ZipFileStore fileStore) {
+            this.fileStore = fileStore;
         }
 
         public FileStoreSpaceAttributes readAttributes() throws IOException {
-            if (fileStore == null) {
-                throw new IllegalStateException();
-            }
             // get the size of the zip file
             String file = fileStore.name();
             Path path = FileSystems.getDefault().getPath(file);
--- a/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFileSystem.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFileSystem.java	Tue Jul 22 11:58:11 2008 +0100
@@ -193,18 +193,7 @@
     }
 
     @Override
-    @SuppressWarnings("unchecked")
-    public <A extends FileAttributeView> A newFileAttributeView(Class<A> viewType) {
-        Class<?> c = viewType;
-        if (c == BasicFileAttributeView.class) {
-            return (A) new ZipFileBasicAttributeView();
-        }
-        if (c == ZipFileAttributeView.class) {
-            return (A) new ZipFileAttributeView();
-        }
-        if (c == JarFileAttributeView.class) {
-            return (A) new JarFileAttributeView();
-        }
+    public UserPrincipalLookupService getUserPrincipalLookupService() {
         return null;
     }
 
--- a/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFileSystemProvider.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipFileSystemProvider.java	Tue Jul 22 11:58:11 2008 +0100
@@ -73,7 +73,7 @@
         }
         Path nativePath = null;
         try {
-            nativePath = Path.get(uriPath); //making use of underlying URI path parsing
+            nativePath = Paths.get(uriPath); //making use of underlying URI path parsing
         } catch (InvalidPathException e) {
             throw e;
         }
--- a/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipPathParser.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipPathParser.java	Tue Jul 22 11:58:11 2008 +0100
@@ -31,8 +31,7 @@
 
 package com.sun.nio.zipfs;
 
-import java.nio.file.InvalidPathException;
-import java.nio.file.Path;
+import java.nio.file.*;
 import java.util.LinkedList;
 import java.util.Stack;
 import java.util.regex.*;
@@ -67,7 +66,7 @@
         int off = findZipComponent(prefixLen, path);
         if (off == -1) {
             try {
-                Path.get(path); //if any invalid char includes in the
+                Paths.get(path); //if any invalid char includes in the
             // path this statement throws IPE with specific position.
             } catch (InvalidPathException e) {
                 throw new InvalidPathException("", e.getMessage()); //This reduces long stack trace
@@ -75,7 +74,7 @@
             throw new InvalidPathException(path, "Archive Jar/Zip Not Found in the path");
         }
         String pathZip = path.substring(0, off);
-        Path pathUpToZip = Path.get(pathZip);
+        Path pathUpToZip = Paths.get(pathZip);
         String nomalizedPathInZip = null;
         if (off != path.length()) {
             String pathInZip = path.substring(off, path.length());
--- a/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipUtils.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/demo/nio/ZipFileSystem/com/sun/nio/zipfs/ZipUtils.java	Tue Jul 22 11:58:11 2008 +0100
@@ -356,7 +356,7 @@
         zei = entries.get(zfp);
         if (zei != null) {
             if (zfp.getNameCount() == 0) { //zfp.equals(zfp.getRoot())
-                Path p = Path.get(zfp.getFileSystem().getZipFileSystemFile());
+                Path p = Paths.get(zfp.getFileSystem().getZipFileSystemFile());
                 try {
                     long time = java.nio.file.attribute.Attributes.readBasicFileAttributes(p, false).lastModifiedTime();
                     zei.lastModifiedTime = javaTimeToDosTime(time);
--- a/src/share/sample/nio/file/AclEdit.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/sample/nio/file/AclEdit.java	Tue Jul 22 11:58:11 2008 +0100
@@ -235,11 +235,11 @@
             usage();
 
         int fileArg = (action == Action.PRINT) ? 0 : 1;
-        Path file = Path.get(args[fileArg]);
+        Path file = Paths.get(args[fileArg]);
 
         // read file's ACL
         AclFileAttributeView view =
-            file.newFileAttributeView(AclFileAttributeView.class, true);
+            file.getFileAttributeView(AclFileAttributeView.class, true);
         if (view == null) {
             System.err.println("ACLs not supported on this platform");
             System.exit(-1);
@@ -257,7 +257,8 @@
 
             // add ACE to existing ACL
             case ADD: {
-                AclEntry entry = parseAceString(entryString, view);
+                AclEntry entry = parseAceString(entryString, file
+                    .getFileSystem().getUserPrincipalLookupService());
                 if (index >= acl.size()) {
                     acl.add(entry);
                 } else {
@@ -284,7 +285,8 @@
                     System.err.format("Index '%d' is invalid", index);
                     System.exit(-1);
                 }
-                AclEntry entry = parseAceString(entryString, view);
+                AclEntry entry = parseAceString(entryString, file
+                    .getFileSystem().getUserPrincipalLookupService());
                 acl.set(index, entry);
                 view.setAcl(acl);
                 break;
--- a/src/share/sample/nio/file/Copy.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/sample/nio/file/Copy.java	Tue Jul 22 11:58:11 2008 +0100
@@ -182,10 +182,10 @@
         Path[] source = new Path[remaining-1];
         int i=0;
         while (remaining > 1) {
-            source[i++] = Path.get(args[argi++]);
+            source[i++] = Paths.get(args[argi++]);
             remaining--;
         }
-        Path target = Path.get(args[argi]);
+        Path target = Paths.get(args[argi]);
 
         // check if target is a directory
         boolean isDir = false;
--- a/src/share/sample/nio/file/DiskUsage.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/sample/nio/file/DiskUsage.java	Tue Jul 22 11:58:11 2008 +0100
@@ -66,7 +66,7 @@
             }
         } else {
             for (String file: args) {
-                FileStore store = Path.get(file).getFileStore();
+                FileStore store = Paths.get(file).getFileStore();
                 printFileStore(store);
             }
         }
--- a/src/share/sample/nio/file/FileType.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/sample/nio/file/FileType.java	Tue Jul 22 11:58:11 2008 +0100
@@ -40,7 +40,7 @@
             System.exit(-1);
         }
         for (String arg: args) {
-            Path file = Path.get(arg);
+            Path file = Paths.get(arg);
             BasicFileAttributes attrs = Attributes.readBasicFileAttributes(file, true);
 
             String type;
--- a/src/share/sample/nio/file/WatchDir.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/sample/nio/file/WatchDir.java	Tue Jul 22 11:58:11 2008 +0100
@@ -205,7 +205,7 @@
         }
 
         // register directory and process its events
-        Path dir = Path.get(args[dirArg]);
+        Path dir = Paths.get(args[dirArg]);
         new WatchDir(dir, recursive).processEvents();
     }
 }
--- a/src/share/sample/nio/file/Xdd.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/share/sample/nio/file/Xdd.java	Tue Jul 22 11:58:11 2008 +0100
@@ -55,7 +55,7 @@
             usage();
 
         Path file = (args.length == 1) ?
-            Path.get(args[0]) : Path.get(args[2]);
+            Paths.get(args[0]) : Paths.get(args[2]);
 
         // check that named attributes are supported by the file system
         FileStore store = file.getFileStore();
@@ -65,7 +65,7 @@
 
         }
         NamedAttributeView view = file.
-            newFileAttributeView(NamedAttributeView.class, true);
+            getFileAttributeView(NamedAttributeView.class, true);
 
 
         // list named attributes
--- a/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/solaris/classes/sun/nio/fs/LinuxDosFileAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -53,36 +53,19 @@
     private static final int DOS_XATTR_SYSTEM   = 0x04;
     private static final int DOS_XATTR_ARCHIVE  = 0x20;
 
-    // encapsulates the object that we are bound too
-    private volatile FileInfo fileInfo;
+    private final UnixPath file;
+    private final boolean followLinks;
 
-    private FileInfo getFileInfo() {
-        FileInfo res = fileInfo;
-        if (res == null)
-            throw new IllegalStateException();
-        return fileInfo;
-    }
-
-    @Override
-    public DosFileAttributeView bind(FileRef obj) {
-        return bind(obj, true);
-    }
-
-    @Override
-    public DosFileAttributeView bind(FileRef obj, boolean followLinks) {
-        if (obj != null && !(obj instanceof UnixPath))
-            throw new ProviderMismatchException();
-        fileInfo = (obj == null) ? null : new FileInfo(obj, followLinks);
-        return this;
+    LinuxDosFileAttributeView(UnixPath file, boolean followLinks) {
+        this.file = file;
+        this.followLinks = followLinks;
     }
 
     @Override
     public DosFileAttributes readAttributes() throws IOException {
-        FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
         file.checkRead();
 
-        int fd = file.openForAttributeAccess(info.followLinks());
+        int fd = file.openForAttributeAccess(followLinks);
         try {
              final UnixFileAttributes attrs = UnixFileAttributes.get(fd);
              final int dosAttribute = getDosAttribute(fd);
@@ -165,9 +148,7 @@
                                               TimeUnit unit)
         throws IOException
     {
-        FileInfo info = getFileInfo();
-        UnixFileAttributeView.createBasicView()
-            .bind(info.file(), info.followLinks())
+        UnixFileAttributeView.createBasicView(file, followLinks)
             .setTimes(lastModifiedTime, lastAccessTime, createTime, unit);
         return this;
     }
@@ -242,11 +223,9 @@
      * Updates the value of the user.DOSATTRIB extended attribute
      */
     private void updateDosAttribute(int flag, boolean enable) throws IOException {
-        FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
         file.checkWrite();
 
-        int fd = file.openForAttributeAccess(info.followLinks());
+        int fd = file.openForAttributeAccess(followLinks);
         try {
             int oldValue = getDosAttribute(fd);
             int newValue = oldValue;
--- a/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/solaris/classes/sun/nio/fs/LinuxFileSystem.java	Tue Jul 22 11:58:11 2008 +0100
@@ -95,13 +95,12 @@
 
     @Override
     @SuppressWarnings("unchecked")
-    public <V extends FileAttributeView> V newFileAttributeView(Class<V> view)
-    {
+    public <V extends FileAttributeView> V newFileAttributeView(Class<V> view, UnixPath file, boolean followLinks) {
         if (view == DosFileAttributeView.class)
-            return (V) new LinuxDosFileAttributeView();
+            return (V) new LinuxDosFileAttributeView(file, followLinks);
         if (view == NamedAttributeView.class)
-            return (V) new LinuxNamedAttributeView();
-        return super.newFileAttributeView(view);
+            return (V) new LinuxNamedAttributeView(file, followLinks);
+        return super.newFileAttributeView(view, file, followLinks);
     }
 
     @Override
--- a/src/solaris/classes/sun/nio/fs/LinuxNamedAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/solaris/classes/sun/nio/fs/LinuxNamedAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -76,22 +76,20 @@
         return list;
     }
 
-    @Override
-    public NamedAttributeView bind(FileRef file, boolean followLinks) {
-        if (file != null && !(file instanceof UnixPath))
-            throw new ProviderMismatchException();
-        setFileInfo(file, followLinks);
-        return this;
+    private final UnixPath file;
+    private final boolean followLinks;
+
+    LinuxNamedAttributeView(UnixPath file, boolean followLinks) {
+        this.file = file;
+        this.followLinks = followLinks;
     }
 
     @Override
     public Iterable<String> list() throws IOException  {
-        final FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
         if (System.getSecurityManager() != null)
             checkAccess(file.getPathForPermissionCheck(), true, false);
 
-        int fd = file.openForAttributeAccess(info.followLinks());
+        int fd = file.openForAttributeAccess(followLinks);
         NativeBuffer buffer = null;
         try {
             int size = 1024;
@@ -103,7 +101,7 @@
                     return new Iterable<String>() {
                         @Override
                         public Iterator<String> iterator() {
-                            return newIterator(info, list);
+                            return newIterator(list);
                         }
                     };
                 } catch (UnixException x) {
@@ -129,12 +127,10 @@
 
     @Override
     public int size(String name) throws IOException  {
-        FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
         if (System.getSecurityManager() != null)
             checkAccess(file.getPathForPermissionCheck(), true, false);
 
-        int fd = file.openForAttributeAccess(info.followLinks());
+        int fd = file.openForAttributeAccess(followLinks);
         try {
             // fgetxattr returns size if called with size==0
             return fgetxattr(fd, nameAsBytes(file,name), 0L, 0);
@@ -149,8 +145,6 @@
 
     @Override
     public int read(String name, ByteBuffer dst) throws IOException {
-        FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
         if (System.getSecurityManager() != null)
             checkAccess(file.getPathForPermissionCheck(), true, false);
 
@@ -172,7 +166,7 @@
             address = nb.address();
         }
 
-        int fd = file.openForAttributeAccess(info.followLinks());
+        int fd = file.openForAttributeAccess(followLinks);
         try {
             try {
                 int n = fgetxattr(fd, nameAsBytes(file,name), address, rem);
@@ -207,8 +201,6 @@
 
     @Override
     public int write(String name, ByteBuffer src) throws IOException {
-        FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
         if (System.getSecurityManager() != null)
             checkAccess(file.getPathForPermissionCheck(), false, true);
 
@@ -241,7 +233,7 @@
             }
         }
 
-        int fd = file.openForAttributeAccess(info.followLinks());
+        int fd = file.openForAttributeAccess(followLinks);
         try {
             try {
                 fsetxattr(fd, nameAsBytes(file,name), address, rem);
@@ -261,12 +253,11 @@
     }
 
     @Override
-    void implDelete(FileInfo info, String name) throws IOException {
-        UnixPath file = (UnixPath)info.file();
+    public NamedAttributeView delete(String name) throws IOException {
         if (System.getSecurityManager() != null)
             checkAccess(file.getPathForPermissionCheck(), false, true);
 
-        int fd = file.openForAttributeAccess(info.followLinks());
+        int fd = file.openForAttributeAccess(followLinks);
         try {
             fremovexattr(fd, nameAsBytes(file,name));
         } catch (UnixException x) {
@@ -275,6 +266,7 @@
         } finally {
             close(fd);
         }
+        return this;
     }
 
     /**
--- a/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/solaris/classes/sun/nio/fs/SolarisAclFileAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -63,41 +63,12 @@
     private static final short OFFSETOF_FLAGS   = 8;
     private static final short OFFSETOF_TYPE    = 10;
 
-    /**
-     * OWNER@, GROUP@, EVERYONE@
-     */
-    private static final UnixUserPrincipal specialOwner =
-        UnixUserPrincipal.createSpecial("OWNER@");
-    private static final UnixUserPrincipal specialGroup =
-        UnixUserPrincipal.createSpecial("GROUP@");
-    private static final UnixUserPrincipal specialEveryone =
-        UnixUserPrincipal.createSpecial("EVERYONE@");
+    private final UnixPath file;
+    private final boolean followLinks;
 
-    // encapsulates the object that we are bound too
-    private volatile FileInfo fileInfo;
-
-    private FileInfo getFileInfo() {
-        FileInfo res = fileInfo;
-        if (res == null)
-            throw new IllegalStateException();
-        return fileInfo;
-    }
-
-    SolarisAclFileAttributeView() {
-        // nothing to do
-    }
-
-    @Override
-    public AclFileAttributeView bind(FileRef obj) {
-        return bind(obj, true);
-    }
-
-    @Override
-    public AclFileAttributeView bind(FileRef obj, boolean followLinks) {
-        if (obj != null && !(obj instanceof UnixPath))
-            throw new ProviderMismatchException();
-        fileInfo = (obj == null) ? null : new FileInfo(obj, followLinks);
-        return this;
+    SolarisAclFileAttributeView(UnixPath file, boolean followLinks) {
+        this.file = file;
+        this.followLinks = followLinks;
     }
 
     /**
@@ -133,11 +104,11 @@
             int uid;
             if (user.isSpecial()) {
                 uid = -1;
-                if (who.getName().equals(specialOwner.getName()))
+                if (who.getName().equals(UnixUserPrincipal.SPECIAL_OWNER.getName()))
                     flags |= ACE_OWNER;
-                else if (who.getName().equals(specialGroup.getName()))
+                else if (who.getName().equals(UnixUserPrincipal.SPECIAL_GROUP.getName()))
                     flags |= ACE_GROUP;
-                else if (who.getName().equals(specialEveryone.getName()))
+                else if (who.getName().equals(UnixUserPrincipal.SPECIAL_EVERYONE.getName()))
                     flags |= ACE_EVERYONE;
                 else
                     throw new AssertionError("Unable to map special identifier");
@@ -240,11 +211,11 @@
             UnixUserPrincipal who = null;
             if (uid == -1) {
                 if ((flags & ACE_OWNER) > 0)
-                    who = specialOwner;
+                    who = UnixUserPrincipal.SPECIAL_OWNER;
                 if ((flags & ACE_GROUP) > 0)
-                    who = specialGroup;
+                    who = UnixUserPrincipal.SPECIAL_GROUP;
                 if ((flags & ACE_EVERYONE) > 0)
-                    who = specialEveryone;
+                    who = UnixUserPrincipal.SPECIAL_EVERYONE;
                 if (who == null)
                     throw new AssertionError("ACE who not handled");
             } else {
@@ -339,14 +310,11 @@
     public List<AclEntry> getAcl()
         throws IOException
     {
-        FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
-
         // permission check
         checkAccess(file, true, false);
 
         // open file (will fail if file is a link and not following links)
-        int fd = file.openForAttributeAccess(info.followLinks());
+        int fd = file.openForAttributeAccess(followLinks);
         try {
             long address = unsafe.allocateMemory(SIZEOF_ACE_T * MAX_ACL_ENTRIES);
             try {
@@ -373,14 +341,11 @@
     public AclFileAttributeView setAcl(List<AclEntry> acl)
         throws IOException
     {
-        FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
-
         // permission check
         checkAccess(file, false, true);
 
         // open file (will fail if file is a link and not following links)
-        int fd = file.openForAttributeAccess(info.followLinks());
+        int fd = file.openForAttributeAccess(followLinks);
         try {
             // SECURITY: need to copy list as can change during processing
             acl = new ArrayList<AclEntry>(acl);
@@ -416,13 +381,11 @@
     public UserPrincipal getOwner()
         throws IOException
     {
-        FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
         checkAccess(file, true, false);
 
         try {
             UnixFileAttributes attrs =
-                UnixFileAttributes.get(file.getPathForSysCalls(), info.followLinks());
+                UnixFileAttributes.get(file.getPathForSysCalls(), followLinks);
             return UnixUserPrincipal.fromUid(attrs.uid());
         } catch (UnixException x) {
             x.rethrowAsIOException(file);
@@ -434,8 +397,6 @@
     public AclFileAttributeView setOwner(UserPrincipal owner)
         throws IOException
     {
-        FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
         checkAccess(file, true, false);
 
         if (!(owner instanceof UnixUserPrincipal))
@@ -445,7 +406,7 @@
         int uid = ((UnixUserPrincipal)owner).uid();
 
         try {
-            if (info.followLinks()) {
+            if (followLinks) {
                 lchown(file.getPathForSysCalls(), uid, -1);
             } else {
                 chown(file.getPathForSysCalls(), uid, -1);
@@ -455,27 +416,4 @@
         }
         return this;
     }
-
-    @Override
-    public UserPrincipal lookupPrincipalByName(String name)
-        throws IOException
-    {
-        if (name.equals(specialOwner.getName()))
-            return specialOwner;
-        if (name.equals(specialGroup.getName()))
-            return specialGroup;
-        if (name.equals(specialEveryone.getName()))
-            return specialEveryone;
-
-        int uid =  UnixFileAttributeView.lookupPrincipalByName(name, false);
-        return UnixUserPrincipal.fromUid(uid, name);
-    }
-
-    @Override
-    public UserPrincipal lookupPrincipalByGroupName(String group)
-        throws IOException
-    {
-        int gid = UnixFileAttributeView.lookupPrincipalByName(group, true);
-        return UnixUserPrincipal.fromGid(gid, group);
-    }
 }
--- a/src/solaris/classes/sun/nio/fs/SolarisFileSystem.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/solaris/classes/sun/nio/fs/SolarisFileSystem.java	Tue Jul 22 11:58:11 2008 +0100
@@ -102,17 +102,16 @@
 
     @Override
     @SuppressWarnings("unchecked")
-    public <V extends FileAttributeView> V newFileAttributeView(Class<V> view)
-    {
+    public <V extends FileAttributeView> V newFileAttributeView(Class<V> view, UnixPath file, boolean followLinks) {
         if (view == AclFileAttributeView.class)
-            return (V) new SolarisAclFileAttributeView();
+            return (V) new SolarisAclFileAttributeView(file, followLinks);
         if (view == DosFileAttributeView.class && hasSolaris11Features()) {
             // TBD: CIFS server in Nevada supports DOS attributes
         }
         if (view == NamedAttributeView.class) {
-            return(V) new SolarisNamedAttributeView();
+            return(V) new SolarisNamedAttributeView(file, followLinks);
         }
-        return super.newFileAttributeView(view);
+        return super.newFileAttributeView(view, file, followLinks);
     }
 
     @Override
@@ -160,4 +159,17 @@
     FileStore getFileStore(UnixMountEntry entry) {
         return new SolarisFileStore(this, entry);
     }
+
+    @Override
+    public UserPrincipal lookupPrincipalByName(String name)
+        throws IOException
+    {
+        if (name.equals(UnixUserPrincipal.SPECIAL_OWNER.getName()))
+            return UnixUserPrincipal.SPECIAL_OWNER;
+        if (name.equals(UnixUserPrincipal.SPECIAL_GROUP.getName()))
+            return UnixUserPrincipal.SPECIAL_GROUP;
+        if (name.equals(UnixUserPrincipal.SPECIAL_EVERYONE.getName()))
+            return UnixUserPrincipal.SPECIAL_EVERYONE;
+        return super.lookupPrincipalByName(name);
+    }
 }
--- a/src/solaris/classes/sun/nio/fs/SolarisNamedAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/solaris/classes/sun/nio/fs/SolarisNamedAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -44,35 +44,33 @@
     extends AbstractNamedAttributeView
 {
     private byte[] nameAsBytes(UnixPath file, String name) throws IOException {
-        byte[] result = name.getBytes();
+        byte[] bytes = name.getBytes();
         //  "", "." and ".." not allowed
-        if (result.length == 0 || result[0] == '.') {
-            if (result.length <= 1 ||
-                (result.length == 2 && result[1] == '.'))
+        if (bytes.length == 0 || bytes[0] == '.') {
+            if (bytes.length <= 1 ||
+                (bytes.length == 2 && bytes[1] == '.'))
             {
                 throw new FileSystemException(file.getPathForExecptionMessage(),
                     null, "'" + name + "' is not a valid name");
             }
         }
-        return result;
+        return bytes;
     }
 
-    @Override
-    public NamedAttributeView bind(FileRef file, boolean followLinks) {
-        if (file != null && !(file instanceof UnixPath))
-            throw new ProviderMismatchException();
-        setFileInfo(file, followLinks);
-        return this;
+    private final UnixPath file;
+    private final boolean followLinks;
+
+    SolarisNamedAttributeView(UnixPath file, boolean followLinks) {
+        this.file = file;
+        this.followLinks = followLinks;
     }
 
     @Override
     public Iterable<String> list() throws IOException  {
-        final FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
         if (System.getSecurityManager() != null)
             checkAccess(file.getPathForPermissionCheck(), true, false);
 
-        int fd = file.openForAttributeAccess(info.followLinks());
+        int fd = file.openForAttributeAccess(followLinks);
         try {
             try {
                 // open extended attribute directory
@@ -100,7 +98,7 @@
                 return new Iterable<String>() {
                     @Override
                     public Iterator<String> iterator() {
-                        return newIterator(info, list);
+                        return newIterator(list);
                     }
                 };
             } catch (UnixException x) {
@@ -115,12 +113,10 @@
 
     @Override
     public int size(String name) throws IOException  {
-        FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
         if (System.getSecurityManager() != null)
             checkAccess(file.getPathForPermissionCheck(), true, false);
 
-        int fd = file.openForAttributeAccess(info.followLinks());
+        int fd = file.openForAttributeAccess(followLinks);
         try {
             try {
                 // open attribute file
@@ -147,12 +143,10 @@
 
     @Override
     public int read(String name, ByteBuffer dst) throws IOException {
-        FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
         if (System.getSecurityManager() != null)
             checkAccess(file.getPathForPermissionCheck(), true, false);
 
-        int fd = file.openForAttributeAccess(info.followLinks());
+        int fd = file.openForAttributeAccess(followLinks);
         try {
             try {
                 // open attribute file
@@ -188,12 +182,10 @@
 
     @Override
     public int write(String name, ByteBuffer src) throws IOException {
-        FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
         if (System.getSecurityManager() != null)
             checkAccess(file.getPathForPermissionCheck(), false, true);
 
-        int fd = file.openForAttributeAccess(info.followLinks());
+        int fd = file.openForAttributeAccess(followLinks);
         try {
             try {
                 // open/create attribute file
@@ -225,12 +217,11 @@
     }
 
     @Override
-    void implDelete(FileInfo info, String name) throws IOException {
-        UnixPath file = (UnixPath)info.file();
+    public NamedAttributeView delete(String name) throws IOException {
         if (System.getSecurityManager() != null)
             checkAccess(file.getPathForPermissionCheck(), false, true);
 
-        int fd = file.openForAttributeAccess(info.followLinks());
+        int fd = file.openForAttributeAccess(followLinks);
         try {
             int dfd = openat(fd, ".".getBytes(), (O_RDONLY|O_XATTR), 0);
             try {
@@ -245,6 +236,7 @@
         } finally {
             close(fd);
         }
+        return this;
     }
 
     /**
--- a/src/solaris/classes/sun/nio/fs/UnixFileAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/solaris/classes/sun/nio/fs/UnixFileAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -37,38 +37,25 @@
 class UnixFileAttributeView
     implements PosixFileAttributeView
 {
+    private final UnixPath file;
+    private final boolean followLinks;
     private final boolean needRuntimePermissionCheck;
 
-    // encapsulates the object that we are bound too
-    private volatile FileInfo fileInfo;
-
-    private FileInfo getFileInfo() {
-        FileInfo res = fileInfo;
-        if (res == null)
-            throw new IllegalStateException();
-        return fileInfo;
-    }
-
-    private UnixFileAttributeView(boolean needRuntimePermissionCheck) {
+    private UnixFileAttributeView(UnixPath file, boolean followLinks,
+                                  boolean needRuntimePermissionCheck)
+    {
+        this.file = file;
+        this.followLinks = followLinks;
         this.needRuntimePermissionCheck = needRuntimePermissionCheck;
     }
 
-    static BasicFileAttributeView createBasicView() {
-        final UnixFileAttributeView view = new UnixFileAttributeView(false);
+    static BasicFileAttributeView createBasicView(UnixPath file, boolean followLinks) {
+        final UnixFileAttributeView view =
+            new UnixFileAttributeView(file, followLinks, false);
 
         // SECURITY: must wrap to prevent casting to PosixFileAttributeView
         return new BasicFileAttributeView() {
             @Override
-            public BasicFileAttributeView bind(FileRef obj) {
-                view.bind(obj);
-                return this;
-            }
-            @Override
-            public BasicFileAttributeView bind(FileRef obj, boolean followLinks) {
-                view.bind(obj, followLinks);
-                return this;
-            }
-            @Override
             public BasicFileAttributes readAttributes() throws IOException {
                 return view.readAttributes().asBasicFileAttributes();
             }
@@ -86,24 +73,15 @@
         };
     }
 
-    static PosixFileAttributeView createPosixView() {
-        return new UnixFileAttributeView(true);
+    static PosixFileAttributeView createPosixView(UnixPath file, boolean followLinks) {
+        return new UnixFileAttributeView(file, followLinks, true);
     }
 
-    static FileOwnerAttributeView createOwnerView() {
-        final UnixFileAttributeView view = new UnixFileAttributeView(true);
+    static FileOwnerAttributeView createOwnerView(UnixPath file, boolean followLinks) {
+        final UnixFileAttributeView view =
+            new UnixFileAttributeView(file, followLinks, true);
         return new FileOwnerAttributeView() {
             @Override
-            public FileOwnerAttributeView bind(FileRef obj) {
-                view.bind(obj);
-                return this;
-            }
-            @Override
-            public FileOwnerAttributeView bind(FileRef obj, boolean followLinks) {
-                view.bind(obj, followLinks);
-                return this;
-            }
-            @Override
             public UserPrincipal getOwner() throws IOException {
                 return view.readAttributes().owner();
             }
@@ -114,18 +92,6 @@
                 view.setOwner(owner);
                 return this;
             }
-            @Override
-            public UserPrincipal lookupPrincipalByName(String name)
-                throws IOException
-            {
-                return view.lookupPrincipalByName(name);
-            }
-            @Override
-            public UserPrincipal lookupPrincipalByGroupName(String group)
-                throws IOException
-            {
-                return view.lookupPrincipalByGroupName(group);
-            }
         };
     }
 
@@ -146,27 +112,11 @@
     }
 
     @Override
-    public PosixFileAttributeView bind(FileRef obj) {
-        return bind(obj, true);
-    }
-
-    @Override
-    public PosixFileAttributeView bind(FileRef obj, boolean followLinks) {
-        if (obj != null && !(obj instanceof UnixPath))
-            throw new ProviderMismatchException();
-        fileInfo = (obj == null) ? null : new FileInfo(obj, followLinks);
-        return this;
-    }
-
-    @Override
     public UnixFileAttributes readAttributes() throws IOException {
-        FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
-
         checkAccess(file, true, false, needRuntimePermissionCheck);
         try {
              UnixFileAttributes attrs =
-                 UnixFileAttributes.get(file.getPathForSysCalls(), info.followLinks());
+                 UnixFileAttributes.get(file.getPathForSysCalls(), followLinks);
              return attrs;
         } catch (UnixException x) {
             x.rethrowAsIOException(file);
@@ -192,9 +142,6 @@
             return this;
         }
 
-        FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
-        boolean followLinks = info.followLinks();
         checkAccess(file, false, true, false);
 
         int fd = file.openForAttributeAccess(followLinks);
@@ -255,14 +202,12 @@
     public PosixFileAttributeView setPermissions(Set<PosixFilePermission> perms)
         throws IOException
     {
-        FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
         checkAccess(file, false, true, false);
 
         int mode = UnixFileModeAttribute.toUnixMode(perms);
 
         try {
-            if (info.followLinks()) {
+            if (followLinks) {
                 chmod(file.getPathForSysCalls(), mode);
             } else {
                 int fd = file.openForAttributeAccess(false);
@@ -282,14 +227,11 @@
     private PosixFileAttributeView updateOwners(int uid, int gid)
         throws IOException
     {
-        FileInfo info = getFileInfo();
-        UnixPath file = (UnixPath)info.file();
-
         // permission check
         checkAccess(file, false, true, true);
 
         try {
-            if (info.followLinks()) {
+            if (followLinks) {
                 chown(file.getPathForSysCalls(), uid, gid);
             } else {
                 lchown(file.getPathForSysCalls(), uid, gid);
@@ -323,41 +265,4 @@
         int gid = ((UnixUserPrincipal)group).gid();
         return updateOwners(-1, gid);
     }
-
-
-    // package-private
-    static int lookupPrincipalByName(String name, boolean isGroup)
-        throws IOException
-    {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new RuntimePermission("lookupUserInformation"));
-        }
-        int id = -1;
-        try {
-            id = (isGroup) ? getgrnam(name.getBytes()) : getpwnam(name.getBytes());
-        } catch (UnixException x) {
-            throw new IOException(name + ": " + x.errorString());
-        }
-        if (id == -1)
-            throw new UserPrincipalNotFoundException(name);
-        return id;
-
-    }
-
-    @Override
-    public UserPrincipal lookupPrincipalByName(String name)
-        throws IOException
-    {
-        int uid = lookupPrincipalByName(name, false);
-        return UnixUserPrincipal.fromUid(uid, name);
-    }
-
-    @Override
-    public UserPrincipal lookupPrincipalByGroupName(String group)
-        throws IOException
-    {
-        int gid = lookupPrincipalByName(group, true);
-        return UnixUserPrincipal.fromGid(gid, group);
-    }
 }
--- a/src/solaris/classes/sun/nio/fs/UnixFileStore.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/solaris/classes/sun/nio/fs/UnixFileStore.java	Tue Jul 22 11:58:11 2008 +0100
@@ -111,10 +111,10 @@
 
     @Override
     @SuppressWarnings("unchecked")
-    public <V extends FileStoreAttributeView> V newFileStoreAttributeView(Class<V> viewType)
+    public <V extends FileStoreAttributeView> V getFileStoreAttributeView(Class<V> viewType)
     {
         if (viewType == FileStoreSpaceAttributeView.class) {
-            return (V) new UnixFileStoreAttributeView().bind(this);
+            return (V) new UnixFileStoreAttributeView(this);
         }
         return (V) null;
     }
@@ -146,23 +146,16 @@
     private static class UnixFileStoreAttributeView
         implements FileStoreSpaceAttributeView
     {
-        private volatile UnixFileStore obj;
+        private final UnixFileStore fs;
 
-        @Override
-        public UnixFileStoreAttributeView bind(FileStore obj) {
-            if (obj != null && !(obj instanceof UnixFileStore))
-                throw new ProviderMismatchException();
-            this.obj = (UnixFileStore)obj;
-            return this;
+        UnixFileStoreAttributeView(UnixFileStore fs) {
+            this.fs = fs;
         }
 
         @Override
         public FileStoreSpaceAttributes readAttributes()
             throws IOException
         {
-            UnixFileStore fs = obj;
-            if (fs == null)
-                throw new IllegalStateException();
             UnixPath file = fs.file();
 
             SecurityManager sm = System.getSecurityManager();
@@ -245,7 +238,7 @@
     private static Properties loadProperties() {
         Properties result = new Properties();
         String fstypes = System.getProperty("java.home") + "/lib/fstypes.properties";
-        FileRef file = Path.get(fstypes);
+        FileRef file = Paths.get(fstypes);
         try {
             ReadableByteChannel rbc = file.newSeekableByteChannel();
             try {
--- a/src/solaris/classes/sun/nio/fs/UnixFileSystem.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/solaris/classes/sun/nio/fs/UnixFileSystem.java	Tue Jul 22 11:58:11 2008 +0100
@@ -41,7 +41,7 @@
  */
 
 abstract class UnixFileSystem
-    extends FileSystem
+    extends FileSystem implements UserPrincipalLookupService
 {
     private final UnixFileSystemProvider provider;
     private final byte[] defaultDirectory;
@@ -287,19 +287,34 @@
         return list;
     }
 
-    @Override
     @SuppressWarnings("unchecked")
-    public <V extends FileAttributeView> V newFileAttributeView(Class<V> view)
-    {
+    protected <V extends FileAttributeView> V newFileAttributeView(Class<V> view, UnixPath file, boolean followLinks) {
         if (view == null)
             throw new NullPointerException();
         Class<?> c = view;
         if (c == BasicFileAttributeView.class)
-            return (V) UnixFileAttributeView.createBasicView();
+            return (V) UnixFileAttributeView.createBasicView(file, followLinks);
         if (c == PosixFileAttributeView.class)
-            return (V) UnixFileAttributeView.createPosixView();
+            return (V) UnixFileAttributeView.createPosixView(file, followLinks);
         if (c == FileOwnerAttributeView.class)
-            return (V) UnixFileAttributeView.createOwnerView();
+            return (V) UnixFileAttributeView.createOwnerView(file, followLinks);
         return (V) null;
     }
+
+    @Override
+    public final UserPrincipalLookupService getUserPrincipalLookupService() {
+        return this;
+    }
+
+    @Override
+    public UserPrincipal lookupPrincipalByName(String name) throws IOException {
+        return UnixUserPrincipal.lookupPrincipalByName(name);
+    }
+
+    @Override
+    public UserPrincipal lookupPrincipalByGroupName(String group)
+        throws IOException
+    {
+        return UnixUserPrincipal.lookupPrincipalByGroupName(group);
+    }
 }
--- a/src/solaris/classes/sun/nio/fs/UnixPath.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/solaris/classes/sun/nio/fs/UnixPath.java	Tue Jul 22 11:58:11 2008 +0100
@@ -779,12 +779,12 @@
     @Override
     @SuppressWarnings("unchecked")
     public <V extends FileAttributeView> V
-        newFileAttributeView(Class<V> view, boolean followLinks)
+        getFileAttributeView(Class<V> view, boolean followLinks)
     {
-        FileAttributeView result = getFileSystem().newFileAttributeView(view);
+        FileAttributeView result = getFileSystem().newFileAttributeView(view, this, followLinks);
         if (result == null)
             return null;
-        return (V) result.bind(this, followLinks);
+        return (V) result;
     }
 
     @Override
--- a/src/solaris/classes/sun/nio/fs/UnixSecureDirectoryStream.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/solaris/classes/sun/nio/fs/UnixSecureDirectoryStream.java	Tue Jul 22 11:58:11 2008 +0100
@@ -259,7 +259,7 @@
     }
 
     @SuppressWarnings("unchecked")
-    private <V extends FileAttributeView> V newFileAttributeViewImpl(UnixPath file,
+    private <V extends FileAttributeView> V getFileAttributeViewImpl(UnixPath file,
                                                                      Class<V> type,
                                                                      boolean followLinks)
     {
@@ -267,35 +267,33 @@
             throw new NullPointerException();
         Class<?> c = type;
         if (c == BasicFileAttributeView.class) {
-            BasicFileAttributeView view = UnixFileAttributeView.createBasicView();
-            return (V) new BasicForwardingFileAttributeView(file, view, followLinks);
+            return (V) new BasicFileAttributeViewImpl(file, followLinks);
         }
         if (c == PosixFileAttributeView.class || c == FileOwnerAttributeView.class) {
-            PosixFileAttributeView view = UnixFileAttributeView.createPosixView();
-            return (V) new PosixForwardingFileAttributeView(file, view, followLinks);
+            return (V) new PosixFileAttributeViewImpl(file, followLinks);
         }
         // TBD - should also support AclFileAttributeView
         return (V) null;
     }
 
     /**
-     * Returns file attribute view is initially bound to this directory
+     * Returns file attribute view bound to this directory
      */
     @Override
-    public <V extends FileAttributeView> V newFileAttributeView(Class<V> type) {
-        return newFileAttributeViewImpl(null, type, false);
+    public <V extends FileAttributeView> V getFileAttributeView(Class<V> type) {
+        return getFileAttributeViewImpl(null, type, false);
     }
 
     /**
-     * Returns file attribute view is initially bound to dfd/filename.
+     * Returns file attribute view bound to dfd/filename.
      */
     @Override
-    public <V extends FileAttributeView> V newFileAttributeView(Path obj,
+    public <V extends FileAttributeView> V getFileAttributeView(Path obj,
                                                                 Class<V> type,
                                                                 boolean followLinks)
     {
         UnixPath file = getName(obj);
-        return newFileAttributeViewImpl(file, type, followLinks);
+        return getFileAttributeViewImpl(file, type, followLinks);
     }
 
     /**
@@ -303,24 +301,19 @@
      * pair. When the bind method is used to bind the view to a another file
      * then it forwards.
      */
-    private class BasicForwardingFileAttributeView
+    private class BasicFileAttributeViewImpl
         implements BasicFileAttributeView
     {
         final UnixPath file;
-        final BasicFileAttributeView forwardee;
         final boolean followLinks;
 
         // set to true when binding to another object
         volatile boolean forwarding;
 
-        BasicForwardingFileAttributeView(UnixPath file,
-                                         BasicFileAttributeView forwardee,
-                                         boolean followLinks)
+        BasicFileAttributeViewImpl(UnixPath file, boolean followLinks)
         {
             this.file = file;
-            this.forwardee = forwardee;
             this.followLinks = followLinks;
-            this.forwarding = false;
         }
 
         int open() throws IOException {
@@ -343,22 +336,7 @@
         }
 
         @Override
-        public BasicFileAttributeView bind(FileRef obj) {
-            return bind(obj, true);
-        }
-
-        @Override
-        public BasicFileAttributeView bind(FileRef obj, boolean followLinks) {
-            forwardee.bind(obj, followLinks);
-            forwarding = true;
-            return this;
-        }
-
-        @Override
         public BasicFileAttributes readAttributes() throws IOException {
-            if (forwarding)
-                return forwardee.readAttributes();
-
             ds.readLock().lock();
             try {
                 if (!ds.isOpen())
@@ -396,11 +374,6 @@
                                                TimeUnit unit)
             throws IOException
         {
-            if (forwarding) {
-                forwardee.setTimes(lastModifiedTime, lastAccessTime, createTime, unit);
-                return this;
-            }
-
             // no effect
             if (lastModifiedTime == null && lastAccessTime == null) {
                 return this;
@@ -475,14 +448,11 @@
      * the bind method is used to bind the view to a another file then it
      * forwards.
      */
-    private class PosixForwardingFileAttributeView
-        extends BasicForwardingFileAttributeView implements PosixFileAttributeView
+    private class PosixFileAttributeViewImpl
+        extends BasicFileAttributeViewImpl implements PosixFileAttributeView
     {
-        PosixForwardingFileAttributeView(UnixPath file,
-                                         PosixFileAttributeView forwardee,
-                                         boolean followLinks)
-        {
-            super(file, forwardee, followLinks);
+        PosixFileAttributeViewImpl(UnixPath file, boolean followLinks) {
+            super(file, followLinks);
         }
 
         private void checkWriteAndUserAccess() {
@@ -494,22 +464,7 @@
         }
 
         @Override
-        public PosixFileAttributeView bind(FileRef obj) {
-            super.bind(obj);
-            return this;
-        }
-
-        @Override
-        public PosixFileAttributeView bind(FileRef obj, boolean followLinks) {
-            super.bind(obj, followLinks);
-            return this;
-        }
-
-        @Override
         public PosixFileAttributes readAttributes() throws IOException {
-            if (forwarding)
-                return (PosixFileAttributes)forwardee.readAttributes();
-
             SecurityManager sm = System.getSecurityManager();
             if (sm != null) {
                 if (file == null)
@@ -540,8 +495,8 @@
 
         @Override
         public Attribute<Set<PosixFilePermission>> newPermissionsAttribute() {
-            // always forward
-            return ((PosixFileAttributeView)forwardee).newPermissionsAttribute();
+            return UnixFileAttributeView.createPosixView(file, followLinks)
+                .newPermissionsAttribute();
         }
 
         @Override
@@ -560,11 +515,6 @@
         public PosixFileAttributeView setPermissions(Set<PosixFilePermission> perms)
             throws IOException
         {
-            if (forwarding) {
-                ((PosixFileAttributeView)forwardee).setPermissions(perms);
-                return this;
-            }
-
             // permission check
             checkWriteAndUserAccess();
 
@@ -616,10 +566,6 @@
         public PosixFileAttributeView setOwner(UserPrincipal owner)
             throws IOException
         {
-            if (forwarding) {
-                ((PosixFileAttributeView)forwardee).setOwner(owner);
-                return this;
-            }
             if (owner.isGroup())
                 throw new IllegalArgumentException("Owner parameter can't be group");
             if (!(owner instanceof UnixUserPrincipal))
@@ -633,10 +579,6 @@
         public PosixFileAttributeView setGroup(UserPrincipal group)
             throws IOException
         {
-            if (forwarding) {
-                ((PosixFileAttributeView)forwardee).setGroup(group);
-                return this;
-            }
             if (!group.isGroup())
                 throw new IllegalArgumentException("Group parameter must be a group");
             if (!(group instanceof UnixUserPrincipal))
@@ -645,21 +587,5 @@
             setOwners(-1, gid);
             return this;
         }
-
-        @Override
-        public UserPrincipal lookupPrincipalByName(String name)
-            throws IOException
-        {
-            // always forward
-            return ((PosixFileAttributeView)forwardee).lookupPrincipalByGroupName(name);
-        }
-
-        @Override
-        public UserPrincipal lookupPrincipalByGroupName(String group)
-            throws IOException
-        {
-            // always forward
-            return ((PosixFileAttributeView)forwardee).lookupPrincipalByGroupName(group);
-        }
     }
 }
--- a/src/solaris/classes/sun/nio/fs/UnixUserPrincipal.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/solaris/classes/sun/nio/fs/UnixUserPrincipal.java	Tue Jul 22 11:58:11 2008 +0100
@@ -26,6 +26,8 @@
 package sun.nio.fs;
 
 import java.nio.file.attribute.UserPrincipal;
+import java.nio.file.attribute.UserPrincipalNotFoundException;
+import java.io.IOException;
 import static sun.nio.fs.UnixNativeDispatcher.*;
 
 /**
@@ -35,6 +37,14 @@
 class UnixUserPrincipal
     implements UserPrincipal
 {
+    private static UnixUserPrincipal createSpecial(String name) {
+        return new UnixUserPrincipal(-1, false, name);
+    }
+
+    static final UnixUserPrincipal SPECIAL_OWNER = createSpecial("OWNER@");
+    static final UnixUserPrincipal SPECIAL_GROUP = createSpecial("GROUP@");
+    static final UnixUserPrincipal SPECIAL_EVERYONE = createSpecial("EVERYONE@");
+
     private final int id;             // uid or gid
     private final boolean isGroup;
     private final String name;
@@ -56,11 +66,6 @@
         return new UnixUserPrincipal(uid, false, name);
     }
 
-    // return UserPrincipal representing given uid and name
-    static UnixUserPrincipal fromUid(int uid, String name) {
-        return new UnixUserPrincipal(uid, false, name);
-    }
-
     // return (group) UserPrincipal representing given gid
     static UnixUserPrincipal fromGid(int gid) {
         String name = null;
@@ -72,14 +77,36 @@
         return new UnixUserPrincipal(gid, true, name);
     }
 
-    // return (group) UserPrincipal representing given gid and name
-    static UnixUserPrincipal fromGid(int gid, String name) {
-        return new UnixUserPrincipal(gid, true, name);
+    // lookup user or group name
+    private static int lookupPrincipalByName(String name, boolean isGroup)
+        throws IOException
+    {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkPermission(new RuntimePermission("lookupUserInformation"));
+        }
+        int id = -1;
+        try {
+            id = (isGroup) ? getgrnam(name.getBytes()) : getpwnam(name.getBytes());
+        } catch (UnixException x) {
+            throw new IOException(name + ": " + x.errorString());
+        }
+        if (id == -1)
+            throw new UserPrincipalNotFoundException(name);
+        return id;
+
     }
 
-    // return special UserPrincipal (OWNER@, GROUP@, ...)
-    static UnixUserPrincipal createSpecial(String name) {
-        return fromUid(-1, name);
+    // lookup user name
+    static UserPrincipal lookupPrincipalByName(String name) throws IOException {
+        int uid = lookupPrincipalByName(name, false);
+        return new UnixUserPrincipal(uid, false, name);
+    }
+
+    // lookup group name
+    static UserPrincipal lookupPrincipalByGroupName(String group) throws IOException {
+        int gid = lookupPrincipalByName(group, true);
+        return new UnixUserPrincipal(gid, true, group);
     }
 
     int uid() {
--- a/src/windows/classes/sun/nio/fs/WindowsAclFileAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/windows/classes/sun/nio/fs/WindowsAclFileAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -90,30 +90,12 @@
     private static final short OFFSETOF_ACCESS_MASK         = 4;
     private static final short OFFSETOF_SID                 = 8;
 
-    // encapsulates the object that we are bound too
-    private volatile FileInfo fileInfo;
+    private final WindowsPath file;
+    private final boolean followLinks;
 
-    private FileInfo getFileInfo() {
-        FileInfo res = fileInfo;
-        if (res == null)
-            throw new IllegalStateException();
-        return fileInfo;
-    }
-
-    WindowsAclFileAttributeView() {
-    }
-
-    @Override
-    public AclFileAttributeView bind(FileRef obj) {
-        return bind(obj, true);
-    }
-
-    @Override
-    public AclFileAttributeView bind(FileRef obj, boolean followLinks) {
-        if (obj != null && !(obj instanceof WindowsPath))
-            throw new ProviderMismatchException();
-        fileInfo = (obj == null) ? null : new FileInfo(obj, followLinks);
-        return this;
+    WindowsAclFileAttributeView(WindowsPath file, boolean followLinks) {
+        this.file = file;
+        this.followLinks = followLinks;
     }
 
     // permision check
@@ -168,15 +150,12 @@
     public UserPrincipal getOwner()
         throws IOException
     {
-        FileInfo info = getFileInfo();
-        WindowsPath file = (WindowsPath)info.file();
         checkAccess(file, true, false);
 
         // GetFileSecurity does not follow links so when following links we
         // need the final target
-        String path = info.followLinks() ?
-            WindowsLinkSupport.getFinalPath(file) : file.getPathForWin32Calls();
-
+        String path = followLinks ? WindowsLinkSupport.getFinalPath(file) :
+                                    file.getPathForWin32Calls();
         NativeBuffer buffer = getFileSecurity(path, OWNER_SECURITY_INFORMATION);
         try {
             // get the address of the SID
@@ -325,14 +304,12 @@
     public List<AclEntry> getAcl()
         throws IOException
     {
-        FileInfo info = getFileInfo();
-        WindowsPath file = (WindowsPath)info.file();
         checkAccess(file, true, false);
 
         // GetFileSecurity does not follow links so when following links we
         // need the final target
-        String path = info.followLinks() ?
-            WindowsLinkSupport.getFinalPath(file) : file.getPathForWin32Calls();
+        String path = followLinks ? WindowsLinkSupport.getFinalPath(file) :
+                                    file.getPathForWin32Calls();
 
         // ALLOW and DENY entries in DACL;
         // AUDIT entries in SACL (ignore for now as it requires privileges)
@@ -374,14 +351,12 @@
     public AclFileAttributeView setOwner(UserPrincipal obj)
         throws IOException
     {
-        FileInfo info = getFileInfo();
-        WindowsPath file = (WindowsPath)info.file();
         checkAccess(file, false, true);
 
         // SetFileSecurity does not follow links so when following links we
         // need the final target
-        String path = info.followLinks() ?
-            WindowsLinkSupport.getFinalPath(file) : file.getPathForWin32Calls();
+        String path = followLinks ? WindowsLinkSupport.getFinalPath(file) :
+                                    file.getPathForWin32Calls();
 
         if (!(obj instanceof WindowsUserPrincipal))
             throw new ProviderMismatchException();
@@ -430,14 +405,12 @@
     public AclFileAttributeView setAcl(List<AclEntry> acl)
         throws IOException
     {
-        FileInfo info = getFileInfo();
-        WindowsPath file = (WindowsPath)info.file();
         checkAccess(file, false, true);
 
         // SetFileSecurity does not follow links so when following links we
         // need the final target
-        String path = info.followLinks() ?
-            WindowsLinkSupport.getFinalPath(file) : file.getPathForWin32Calls();
+        String path = followLinks ? WindowsLinkSupport.getFinalPath(file) :
+                                    file.getPathForWin32Calls();
 
         // SECURITY: need to copy list in case size changes
         acl = new ArrayList<AclEntry>(acl);
@@ -509,58 +482,6 @@
         return this;
     }
 
-    // invokes LookupAccountName to lookup account
-    private UserPrincipal lookupPrincipalByNameImpl(String name)
-        throws IOException
-    {
-        SecurityManager sm = System.getSecurityManager();
-        if (sm != null) {
-            sm.checkPermission(new RuntimePermission("lookupUserInformation"));
-        }
-
-        // invoke LookupAccountName to get buffer size needed for SID
-        int size = 0;
-        try {
-            size = LookupAccountName(name, 0L, 0);
-        } catch (WindowsException x) {
-            if (x.lastError() == ERROR_NONE_MAPPED)
-                throw new UserPrincipalNotFoundException(name);
-            throw new IOException(name + ": " + x.errorString());
-        }
-        assert size > 0;
-
-        // allocate buffer and re-invoke LookupAccountName get SID
-        NativeBuffer sidBuffer = NativeBuffers.getNativeBuffer(size);
-        try {
-            int newSize = LookupAccountName(name, sidBuffer.address(), size);
-            if (newSize != size) {
-                // can this happen?
-                throw new AssertionError("SID change during lookup");
-            }
-
-            // return user principal
-            return new WindowsUserPrincipal(sidBuffer.address());
-        } catch (WindowsException x) {
-            throw new IOException(name + ": " + x.errorString());
-        } finally {
-            sidBuffer.release();
-        }
-    }
-
-    @Override
-    public UserPrincipal lookupPrincipalByName(String name)
-        throws IOException
-    {
-        return lookupPrincipalByNameImpl(name);
-    }
-
-    @Override
-    public UserPrincipal lookupPrincipalByGroupName(String group)
-        throws IOException
-    {
-        return lookupPrincipalByNameImpl(group);
-    }
-
     @Override
     public Attribute<List<AclEntry>> newAclAttribute() {
         throw new UnsupportedOperationException();
--- a/src/windows/classes/sun/nio/fs/WindowsFileAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/windows/classes/sun/nio/fs/WindowsFileAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -36,38 +36,16 @@
 class WindowsFileAttributeView
     implements DosFileAttributeView
 {
-    // encapsulates the object that we are bound too
-    private volatile FileInfo fileInfo;
+    private final WindowsPath file;
+    private final boolean followLinks;
 
-    private FileInfo getFileInfo() {
-        FileInfo res = fileInfo;
-        if (res == null)
-            throw new IllegalStateException();
-        return fileInfo;
-    }
-
-    WindowsFileAttributeView() {
-    }
-
-    @Override
-    public DosFileAttributeView bind(FileRef obj) {
-        return bind(obj, true);
-    }
-
-    @Override
-    public DosFileAttributeView bind(FileRef obj, boolean followLinks) {
-        if (obj != null && !(obj instanceof WindowsPath))
-            throw new ProviderMismatchException();
-        this.fileInfo = (obj == null) ? null :
-            new FileInfo((WindowsPath)obj, followLinks);
-        return this;
+    WindowsFileAttributeView(WindowsPath file, boolean followLinks) {
+        this.file = file;
+        this.followLinks = followLinks;
     }
 
     @Override
     public DosFileAttributes readAttributes() throws IOException {
-        FileInfo info = getFileInfo();
-        WindowsPath file = (WindowsPath)info.file();
-        boolean followLinks = info.followLinks();
         file.checkRead();
 
         try {
@@ -117,8 +95,6 @@
                                          TimeUnit unit)
         throws IOException
     {
-        FileInfo info = getFileInfo();
-        WindowsPath file = (WindowsPath)info.file();
         file.checkWrite();
 
         // if all null then do nothing
@@ -164,7 +140,7 @@
             crTime = WindowsFileAttributes.toWindowsTime(crTime);
         }
 
-        setFileTimes(file, info.followLinks(), crTime, accTime, modTime);
+        setFileTimes(file, followLinks, crTime, accTime, modTime);
         return this;
     }
 
@@ -174,14 +150,12 @@
     private DosFileAttributeView updateAttributes(int flag, boolean enable)
         throws IOException
     {
-        FileInfo info = getFileInfo();
-        WindowsPath file = (WindowsPath)info.file();
         file.checkWrite();
 
         // GetFileAttribtues & SetFileAttributes do not follow links so when
         // following links we need the final target
-        String path = info.followLinks() ?
-            WindowsLinkSupport.getFinalPath(file) : file.getPathForWin32Calls();
+        String path = followLinks ? WindowsLinkSupport.getFinalPath(file) :
+                                    file.getPathForWin32Calls();
 
         try {
             int oldValue = GetFileAttributes(path);
@@ -237,11 +211,9 @@
 
         // copy file times to target - must be done after updating FAT attributes
         // as otherwise the last modified time may be wrong.
-        FileInfo info = getFileInfo();
-
         setFileTimes(
-            (WindowsPath)(info.file()),
-            info.followLinks(),
+            file,
+            followLinks,
             WindowsFileAttributes.toWindowsTime(attrs.creationTime()),
             WindowsFileAttributes.toWindowsTime(attrs.lastModifiedTime()),
             WindowsFileAttributes.toWindowsTime(attrs.lastAccessTime()));
--- a/src/windows/classes/sun/nio/fs/WindowsFileCopy.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/windows/classes/sun/nio/fs/WindowsFileCopy.java	Tue Jul 22 11:58:11 2008 +0100
@@ -199,8 +199,8 @@
         }
         if (copyAttributes) {
             // copy DOS/timestamps attributes
-            WindowsFileAttributeView view = new WindowsFileAttributeView();
-            view.bind(target, false);
+            WindowsFileAttributeView view =
+                new WindowsFileAttributeView(target, false);
             try {
                 view.setAttributes(sourceAttrs);
             } catch (IOException x) {
@@ -389,8 +389,7 @@
         }
 
         // copy timestamps/DOS attributes
-        WindowsFileAttributeView view = new WindowsFileAttributeView();
-        view.bind(target, false);
+        WindowsFileAttributeView view = new WindowsFileAttributeView(target, false);
         try {
             view.setAttributes(sourceAttrs);
         } catch (IOException x) {
--- a/src/windows/classes/sun/nio/fs/WindowsFileStore.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/windows/classes/sun/nio/fs/WindowsFileStore.java	Tue Jul 22 11:58:11 2008 +0100
@@ -125,10 +125,10 @@
 
     @Override
     @SuppressWarnings("unchecked")
-    public <V extends FileStoreAttributeView> V newFileStoreAttributeView(Class<V> view)
+    public <V extends FileStoreAttributeView> V getFileStoreAttributeView(Class<V> view)
     {
         if (view == FileStoreSpaceAttributeView.class) {
-            return (V) new WindowsFileStoreAttributeView().bind(this);
+            return (V) new WindowsFileStoreAttributeView(this);
         }
         return (V) null;
     }
@@ -184,7 +184,11 @@
     static class WindowsFileStoreAttributeView
         implements FileStoreSpaceAttributeView
     {
-        private volatile WindowsFileStore obj;
+        private final WindowsFileStore fs;
+
+        WindowsFileStoreAttributeView(WindowsFileStore fs) {
+            this.fs = fs;
+        }
 
         private void checkAccess(WindowsFileStore fs) {
             SecurityManager sm = System.getSecurityManager();
@@ -195,21 +199,9 @@
         }
 
         @Override
-        public WindowsFileStoreAttributeView bind(FileStore obj) {
-            if (obj != null && !(obj instanceof WindowsFileStore))
-                throw new ProviderMismatchException();
-            this.obj = (WindowsFileStore)obj;
-            return this;
-        }
-
-        @Override
         public FileStoreSpaceAttributes readAttributes()
             throws IOException
         {
-            WindowsFileStore fs = obj;
-            if (fs == null)
-                throw new IllegalStateException();
-
             // permission check
             checkAccess(fs);
 
--- a/src/windows/classes/sun/nio/fs/WindowsFileSystem.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/windows/classes/sun/nio/fs/WindowsFileSystem.java	Tue Jul 22 11:58:11 2008 +0100
@@ -41,7 +41,7 @@
 import static sun.nio.fs.WindowsConstants.*;
 
 class WindowsFileSystem
-    extends FileSystem
+    extends FileSystem implements UserPrincipalLookupService
 {
     private final WindowsFileSystemProvider provider;
 
@@ -223,6 +223,61 @@
         return new WindowsPath(this, result.type(), result.root(), result.path());
     }
 
+    // lookup of user or group
+    private UserPrincipal lookupPrincipalByNameImpl(String name) throws IOException {
+        SecurityManager sm = System.getSecurityManager();
+        if (sm != null) {
+            sm.checkPermission(new RuntimePermission("lookupUserInformation"));
+        }
+
+        // invoke LookupAccountName to get buffer size needed for SID
+        int size = 0;
+        try {
+            size = LookupAccountName(name, 0L, 0);
+        } catch (WindowsException x) {
+            if (x.lastError() == ERROR_NONE_MAPPED)
+                throw new UserPrincipalNotFoundException(name);
+            throw new IOException(name + ": " + x.errorString());
+        }
+        assert size > 0;
+
+        // allocate buffer and re-invoke LookupAccountName get SID
+        NativeBuffer sidBuffer = NativeBuffers.getNativeBuffer(size);
+        try {
+            int newSize = LookupAccountName(name, sidBuffer.address(), size);
+            if (newSize != size) {
+                // can this happen?
+                throw new AssertionError("SID change during lookup");
+            }
+
+            // return user principal
+            return new WindowsUserPrincipal(sidBuffer.address());
+        } catch (WindowsException x) {
+            throw new IOException(name + ": " + x.errorString());
+        } finally {
+            sidBuffer.release();
+        }
+    }
+
+    @Override
+    public UserPrincipal lookupPrincipalByName(String name)
+        throws IOException
+    {
+        return lookupPrincipalByNameImpl(name);
+    }
+
+    @Override
+    public UserPrincipal lookupPrincipalByGroupName(String group)
+        throws IOException
+    {
+        return lookupPrincipalByNameImpl(group);
+    }
+
+    @Override
+    public UserPrincipalLookupService getUserPrincipalLookupService() {
+        return this;
+    }
+
     @Override
     public NameMatcher getNameMatcher(String syntaxAndPattern) {
         String syntax = GLOB_SYNTAX;
@@ -277,7 +332,7 @@
 
     @Override
     public Iterable<Class<? extends FileAttributeView>> getFileAttributeViews() {
-        ArrayList<Class<? extends FileAttributeView>> list =
+        List<Class<? extends FileAttributeView>> list =
             new ArrayList<Class<? extends FileAttributeView>>();
         list.add(BasicFileAttributeView.class);
         list.add(DosFileAttributeView.class);
@@ -288,23 +343,6 @@
     }
 
     @Override
-    @SuppressWarnings("unchecked")
-    public <V extends FileAttributeView> V newFileAttributeView(Class<V> view) {
-        if (view == null)
-            throw new NullPointerException();
-        if (view == BasicFileAttributeView.class ||
-            view == DosFileAttributeView.class)
-            return (V) new WindowsFileAttributeView();
-        if (view == AclFileAttributeView.class ||
-            view == FileOwnerAttributeView.class)
-            return (V) new WindowsAclFileAttributeView();
-        if (view == NamedAttributeView.class) {
-            return (V) new WindowsNamedAttributeView();
-        }
-        return (V) null;
-    }
-
-    @Override
     public WatchService newWatchService()
         throws IOException
     {
--- a/src/windows/classes/sun/nio/fs/WindowsNamedAttributeView.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/windows/classes/sun/nio/fs/WindowsNamedAttributeView.java	Tue Jul 22 11:58:11 2008 +0100
@@ -56,25 +56,23 @@
         return join(file.getPathForWin32Calls(), name);
     }
 
-    @Override
-    public NamedAttributeView bind(FileRef file, boolean followLinks) {
-        if (file != null && !(file instanceof WindowsPath))
-            throw new ProviderMismatchException();
-        setFileInfo(file, followLinks);
-        return this;
+    private final WindowsPath file;
+    private final boolean followLinks;
+
+    WindowsNamedAttributeView(WindowsPath file, boolean followLinks) {
+        this.file = file;
+        this.followLinks = followLinks;
     }
 
     @Override
     public Iterable<String> list() throws IOException  {
-        final FileInfo info = getFileInfo();
-        WindowsPath file = (WindowsPath)info.file();
         if (System.getSecurityManager() != null)
             checkAccess(file.getPathForPermissionCheck(), true, false);
 
         long handle = -1L;
         try {
             int flags = FILE_FLAG_BACKUP_SEMANTICS;
-            if (!info.followLinks() && file.getFileSystem().supportsLinks())
+            if (!followLinks && file.getFileSystem().supportsLinks())
                 flags |= FILE_FLAG_OPEN_REPARSE_POINT;
 
             handle = CreateFile(file.getPathForWin32Calls(),
@@ -174,15 +172,13 @@
         return new Iterable<String>() {
             @Override
             public Iterator<String> iterator() {
-                return newIterator(info, list);
+                return newIterator(list);
             }
         };
     }
 
     @Override
     public int size(String name) throws IOException  {
-        FileInfo info = getFileInfo();
-        WindowsPath file = (WindowsPath)info.file();
         if (System.getSecurityManager() != null)
             checkAccess(file.getPathForPermissionCheck(), true, false);
 
@@ -191,7 +187,7 @@
         try {
             Set<OpenOption> opts = new HashSet<OpenOption>();
             opts.add(READ);
-            if (!info.followLinks())
+            if (!followLinks)
                 opts.add(WindowsChannelFactory.NOFOLLOW_REPARSEPOINT);
             fc = WindowsChannelFactory
                 .newFileChannel(join(file, name), null, opts);
@@ -210,8 +206,6 @@
 
     @Override
     public int read(String name, ByteBuffer dst) throws IOException {
-        FileInfo info = getFileInfo();
-        WindowsPath file = (WindowsPath)info.file();
         if (System.getSecurityManager() != null)
             checkAccess(file.getPathForPermissionCheck(), true, false);
 
@@ -220,7 +214,7 @@
         try {
             Set<OpenOption> opts = new HashSet<OpenOption>();
             opts.add(READ);
-            if (!info.followLinks())
+            if (!followLinks)
                 opts.add(WindowsChannelFactory.NOFOLLOW_REPARSEPOINT);
             fc = WindowsChannelFactory
                 .newFileChannel(join(file, name), null, opts);
@@ -247,8 +241,6 @@
 
     @Override
     public int write(String name, ByteBuffer src) throws IOException {
-        FileInfo info = getFileInfo();
-        WindowsPath file = (WindowsPath)info.file();
         if (System.getSecurityManager() != null)
             checkAccess(file.getPathForPermissionCheck(), false, true);
 
@@ -263,7 +255,7 @@
         long handle = -1L;
         try {
             int flags = FILE_FLAG_BACKUP_SEMANTICS;
-            if (!info.followLinks())
+            if (!followLinks)
                 flags |= FILE_FLAG_OPEN_REPARSE_POINT;
 
             handle = CreateFile(file.getPathForWin32Calls(),
@@ -276,7 +268,7 @@
         }
         try {
             Set<OpenOption> opts = new HashSet<OpenOption>();
-            if (!info.followLinks())
+            if (!followLinks)
                 opts.add(WindowsChannelFactory.NOFOLLOW_REPARSEPOINT);
             opts.add(CREATE);
             opts.add(WRITE);
@@ -304,18 +296,17 @@
     }
 
     @Override
-    void implDelete(FileInfo info, String name) throws IOException {
-        WindowsPath file = (WindowsPath)info.file();
+    public NamedAttributeView delete(String name) throws IOException {
         if (System.getSecurityManager() != null)
             checkAccess(file.getPathForPermissionCheck(), false, true);
 
-        String toDelete = info.followLinks() ?
-            join(WindowsLinkSupport.getFinalPath(file), name) :
-            join(file, name);
+        String toDelete = followLinks ?
+            join(WindowsLinkSupport.getFinalPath(file), name) : join(file, name);
         try {
             DeleteFile(toDelete);
         } catch (WindowsException x) {
             x.rethrowAsIOException(toDelete);
         }
+        return this;
     }
 }
--- a/src/windows/classes/sun/nio/fs/WindowsPath.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/windows/classes/sun/nio/fs/WindowsPath.java	Tue Jul 22 11:58:11 2008 +0100
@@ -818,12 +818,20 @@
     @Override
     @SuppressWarnings("unchecked")
     public <V extends FileAttributeView> V
-        newFileAttributeView(Class<V> view, boolean followLinks)
+        getFileAttributeView(Class<V> view, boolean followLinks)
     {
-        FileAttributeView result  = getFileSystem().newFileAttributeView(view);
-        if (result == null)
-            return null;
-        return (V) result.bind(this, followLinks);
+        if (view == null)
+            throw new NullPointerException();
+        if (view == BasicFileAttributeView.class ||
+            view == DosFileAttributeView.class)
+            return (V) new WindowsFileAttributeView(this, followLinks);
+        if (view == AclFileAttributeView.class ||
+            view == FileOwnerAttributeView.class)
+            return (V) new WindowsAclFileAttributeView(this, followLinks);
+        if (view == NamedAttributeView.class) {
+            return (V) new WindowsNamedAttributeView(this, followLinks);
+        }
+        return (V) null;
     }
 
     @Override
--- a/src/windows/classes/sun/nio/fs/WindowsSecurity.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/src/windows/classes/sun/nio/fs/WindowsSecurity.java	Tue Jul 22 11:58:11 2008 +0100
@@ -79,7 +79,7 @@
 
         long hToken = 0L;
         boolean impersontating = false;
-        boolean evalated = false;
+        boolean elevated = false;
         try {
             hToken = OpenThreadToken(GetCurrentThread(),
                                      TOKEN_ADJUST_PRIVILEGES, false);
@@ -92,7 +92,7 @@
 
             if (hToken != 0L) {
                 AdjustTokenPrivileges(hToken, pLuid, SE_PRIVILEGE_ENABLED);
-                evalated = true;
+                elevated = true;
             }
         } catch (WindowsException x) {
             // nothing to do, privilege not enabled
@@ -100,7 +100,7 @@
 
         final long token = hToken;
         final boolean stopImpersontating = impersontating;
-        final boolean needToRevert = evalated;
+        final boolean needToRevert = elevated;
 
         return new Privilege() {
             @Override
--- a/test/demo/nio/ZipFileSystem/Sanity.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/demo/nio/ZipFileSystem/Sanity.java	Tue Jul 22 11:58:11 2008 +0100
@@ -35,7 +35,7 @@
 public class Sanity {
 
     public static void main(String[] args) throws Exception {
-        Path zipfile = Path.get(args[0]);
+        Path zipfile = Paths.get(args[0]);
 
         // Test: zip should should be returned in provider list
         boolean found = false;
@@ -70,7 +70,7 @@
         // Test: copy file from zip file to current (scratch) directory
         Path source = fs.getPath("/META-INF/services/java.nio.file.spi.FileSystemProvider");
         if (source.exists()) {
-            Path target = Path.get(source.getName().toString());
+            Path target = Paths.get(source.getName().toString());
             source.copyTo(target, StandardCopyOption.REPLACE_EXISTING);
             try {
                 long s1 = Attributes.readBasicFileAttributes(source, true).size();
--- a/test/java/nio/channels/AsynchronousFileChannel/Lock.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/channels/AsynchronousFileChannel/Lock.java	Tue Jul 22 11:58:11 2008 +0100
@@ -294,7 +294,7 @@
                 if (cmd.equals(OPEN_CMD)) {
                     if (fc != null)
                         throw new RuntimeException("File already open");
-                    fc = FileChannel.open(Path.get(param),READ, WRITE);
+                    fc = FileChannel.open(Paths.get(param),READ, WRITE);
                 }
                 if (cmd.equals(CLOSE_CMD)) {
                     if (fc == null)
--- a/test/java/nio/channels/AsynchronousServerSocketChannel/WithSecurityManager.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/channels/AsynchronousServerSocketChannel/WithSecurityManager.java	Tue Jul 22 11:58:11 2008 +0100
@@ -29,7 +29,7 @@
  * @run main/othervm WithSecurityManager deny
  */
 
-import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.nio.channels.*;
 import java.net.*;
 import java.util.concurrent.*;
@@ -45,7 +45,7 @@
             testSrc = ".";
 
         System.setProperty("java.security.policy",
-            Path.get(testSrc).resolve(policy).toString());
+            Paths.get(testSrc).resolve(policy).toString());
         System.setSecurityManager(new SecurityManager());
 
         AsynchronousServerSocketChannel listener =
--- a/test/java/nio/file/DirectoryStream/Basic.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/file/DirectoryStream/Basic.java	Tue Jul 22 11:58:11 2008 +0100
@@ -44,7 +44,7 @@
         });
 
         // create file in directory
-        final Path foo = Path.get("foo");
+        final Path foo = Paths.get("foo");
         dir.resolve(foo).newOutputStream().close();
 
         // iterate over directory and check there is one entry
--- a/test/java/nio/file/DirectoryStream/SecureDS.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/file/DirectoryStream/SecureDS.java	Tue Jul 22 11:58:11 2008 +0100
@@ -65,16 +65,16 @@
         Path dir2 = dir.resolve("dir2");
 
         // create a file, directory, and two sym links in the directory
-        Path fileEntry = Path.get("myfile");
+        Path fileEntry = Paths.get("myfile");
         dir1.resolve(fileEntry).createFile();
-        Path dirEntry = Path.get("mydir");
+        Path dirEntry = Paths.get("mydir");
         dir1.resolve(dirEntry).createDirectory();
         // myfilelink -> myfile
-        Path link1Entry = Path.get("myfilelink");
+        Path link1Entry = Paths.get("myfilelink");
         if (supportsLinks)
             dir1.resolve(link1Entry).createSymbolicLink(fileEntry);
         // mydirlink -> mydir
-        Path link2Entry = Path.get("mydirlink");
+        Path link2Entry = Paths.get("mydirlink");
         if (supportsLinks)
             dir1.resolve(link2Entry).createSymbolicLink(dirEntry);
 
@@ -89,55 +89,48 @@
         for (DirectoryEntry entry: stream) { count++; }
         assertTrue(count == (supportsLinks ? 4 : 2));
 
-        // Test: newFileAttributeView to access directory's attributes
+        // Test: getFileAttributeView to access directory's attributes
         assertTrue(stream
-            .newFileAttributeView(BasicFileAttributeView.class)
+            .getFileAttributeView(BasicFileAttributeView.class)
                 .readAttributes()
                     .isDirectory());
 
-        // Test: newFileAttributeView to access attributes of entries
+        // Test: getFileAttributeView to access attributes of entries
         assertTrue(stream
-            .newFileAttributeView(fileEntry, BasicFileAttributeView.class, true)
+            .getFileAttributeView(fileEntry, BasicFileAttributeView.class, true)
                 .readAttributes()
                     .isRegularFile());
         assertTrue(stream
-            .newFileAttributeView(fileEntry, BasicFileAttributeView.class, false)
+            .getFileAttributeView(fileEntry, BasicFileAttributeView.class, false)
                 .readAttributes()
                     .isRegularFile());
         assertTrue(stream
-            .newFileAttributeView(dirEntry, BasicFileAttributeView.class, true)
+            .getFileAttributeView(dirEntry, BasicFileAttributeView.class, true)
                 .readAttributes()
                     .isDirectory());
         assertTrue(stream
-            .newFileAttributeView(dirEntry, BasicFileAttributeView.class, false)
+            .getFileAttributeView(dirEntry, BasicFileAttributeView.class, false)
                 .readAttributes()
                     .isDirectory());
         if (supportsLinks) {
             assertTrue(stream
-                .newFileAttributeView(link1Entry, BasicFileAttributeView.class, true)
+                .getFileAttributeView(link1Entry, BasicFileAttributeView.class, true)
                     .readAttributes()
                         .isRegularFile());
             assertTrue(stream
-                .newFileAttributeView(link1Entry, BasicFileAttributeView.class, false)
+                .getFileAttributeView(link1Entry, BasicFileAttributeView.class, false)
                     .readAttributes()
                         .isSymbolicLink());
             assertTrue(stream
-                .newFileAttributeView(link2Entry, BasicFileAttributeView.class, true)
+                .getFileAttributeView(link2Entry, BasicFileAttributeView.class, true)
                     .readAttributes()
                         .isDirectory());
             assertTrue(stream
-                .newFileAttributeView(link2Entry, BasicFileAttributeView.class, false)
+                .getFileAttributeView(link2Entry, BasicFileAttributeView.class, false)
                     .readAttributes()
                         .isSymbolicLink());
         }
 
-        // Test: re-binding FileAttributeView to another object
-        assertTrue(stream
-            .newFileAttributeView(fileEntry, BasicFileAttributeView.class, false)
-                .bind(dir)
-                    .readAttributes()
-                        .isDirectory());
-
         // Test: newSeekableByteChannel
         Set<StandardOpenOption> opts = Collections.emptySet();
         stream.newSeekableByteChannel(fileEntry, opts).close();
@@ -196,16 +189,16 @@
         Path dir2 = dir.resolve("dir2").createDirectory();
 
         // create dir1/myfile, dir1/mydir, dir1/mylink
-        Path fileEntry = Path.get("myfile");
+        Path fileEntry = Paths.get("myfile");
         dir1.resolve(fileEntry).createFile();
-        Path dirEntry = Path.get("mydir");
+        Path dirEntry = Paths.get("mydir");
         dir1.resolve(dirEntry).createDirectory();
-        Path linkEntry = Path.get("mylink");
+        Path linkEntry = Paths.get("mylink");
         if (supportsLinks)
-            dir1.resolve(linkEntry).createSymbolicLink(Path.get("missing"));
+            dir1.resolve(linkEntry).createSymbolicLink(Paths.get("missing"));
 
         // target name
-        Path target = Path.get("newfile");
+        Path target = Paths.get("newfile");
 
         // open stream to both directories
         SecureDirectoryStream stream1 =
@@ -229,7 +222,7 @@
         if (supportsLinks) {
             stream1.move(linkEntry, stream2, target);
             assertTrue(dir2.resolve(target)
-                .newFileAttributeView(BasicFileAttributeView.class, false)
+                .getFileAttributeView(BasicFileAttributeView.class, false)
                 .readAttributes()
                 .isSymbolicLink());
             stream2.delete(target);
@@ -238,7 +231,7 @@
         // Test: move between devices
         String testDirAsString = System.getProperty("test.dir");
         if (testDirAsString != null) {
-            Path testDir = Path.get(testDirAsString);
+            Path testDir = Paths.get(testDirAsString);
             if (!dir1.getFileStore().equals(testDir.getFileStore())) {
                 SecureDirectoryStream ts =
                     (SecureDirectoryStream)testDir.newDirectoryStream("*");
@@ -259,7 +252,7 @@
 
     // null and ClosedDirectoryStreamException
     static void miscTests(Path dir) throws IOException {
-        Path file = Path.get("file");
+        Path file = Paths.get("file");
         dir.resolve(file).createFile();
 
         SecureDirectoryStream stream =
@@ -267,15 +260,15 @@
 
         // NullPointerException
         try {
-            stream.newFileAttributeView(null);
+            stream.getFileAttributeView(null);
             shouldNotGetHere();
         } catch (NullPointerException x) { }
         try {
-            stream.newFileAttributeView(null, BasicFileAttributeView.class, true);
+            stream.getFileAttributeView(null, BasicFileAttributeView.class, true);
             shouldNotGetHere();
         } catch (NullPointerException x) { }
         try {
-            stream.newFileAttributeView(file, null, true);
+            stream.getFileAttributeView(file, null, true);
             shouldNotGetHere();
         } catch (NullPointerException x) { }
         try {
--- a/test/java/nio/file/FileStore/Basic.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/file/FileStore/Basic.java	Tue Jul 22 11:58:11 2008 +0100
@@ -66,7 +66,7 @@
          * Test: File and FileStore attributes
          */
         store1.supportsFileAttributeView(BasicFileAttributeView.class);
-        store1.newFileStoreAttributeView(FileStoreSpaceAttributeView.class);
+        store1.getFileStoreAttributeView(FileStoreSpaceAttributeView.class);
         boolean found = false;
         for (Class<? extends FileStoreAttributeView> view:
             store1.getFileStoreAttributeViews())
--- a/test/java/nio/file/Files/ForceLoad.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/file/Files/ForceLoad.java	Tue Jul 22 11:58:11 2008 +0100
@@ -33,6 +33,6 @@
 public class ForceLoad {
 
     public static void main(String[] args) throws IOException {
-        Files.probeContentType(Path.get("."));
+        Files.probeContentType(Paths.get("."));
     }
 }
--- a/test/java/nio/file/Path/CopyAndMove.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/file/Path/CopyAndMove.java	Tue Jul 22 11:58:11 2008 +0100
@@ -51,7 +51,7 @@
             // if test.dir differs to temporary file system then can test
             // moving between devices
             String testDir = System.getProperty("test.dir");
-            Path dir2 = (testDir != null) ? Path.get(testDir) : dir1;
+            Path dir2 = (testDir != null) ? Paths.get(testDir) : dir1;
             doMoveTests(dir1, dir2);
 
         } finally {
@@ -111,7 +111,7 @@
         throws IOException
     {
         NamedAttributeView view = file
-            .newFileAttributeView(NamedAttributeView.class, true);
+            .getFileAttributeView(NamedAttributeView.class, true);
         Map<String,ByteBuffer> result = new HashMap<String,ByteBuffer>();
         for (String name: view.list()) {
             int size = view.size(name);
@@ -436,7 +436,7 @@
          * Test: Move broken symbolic link, target does not exists
          */
         if (supportsLinks) {
-            Path tmp = Path.get("doesnotexist");
+            Path tmp = Paths.get("doesnotexist");
             source = dir1.resolve("link").createSymbolicLink(tmp);
             target = getTargetFile(dir1);
             moveAndVerify(source, target);
@@ -811,7 +811,7 @@
         if (supportsLinks &&
             System.getProperty("os.name").startsWith("Windows"))
         {
-            Path unc = Path.get("\\\\rialto\\share\\file");
+            Path unc = Paths.get("\\\\rialto\\share\\file");
             link = dir.resolve("link").createSymbolicLink(unc);
             target = getTargetFile(dir);
             copyAndVerify(link, target, NOFOLLOW_LINKS);
@@ -922,7 +922,7 @@
 
         if (isWindows) {
             DosFileAttributeView view = file
-                .newFileAttributeView(DosFileAttributeView.class, false);
+                .getFileAttributeView(DosFileAttributeView.class, false);
             // only set or unset the hidden attribute
             view.setHidden(heads());
         }
@@ -935,7 +935,7 @@
 
         if (addNamedAttributes) {
             NamedAttributeView view = file
-                .newFileAttributeView(NamedAttributeView.class, true);
+                .getFileAttributeView(NamedAttributeView.class, true);
             int n = rand.nextInt(16);
             while (n > 0) {
                 byte[] value = new byte[1 + rand.nextInt(100)];
--- a/test/java/nio/file/Path/Links.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/file/Path/Links.java	Tue Jul 22 11:58:11 2008 +0100
@@ -51,7 +51,7 @@
 
         // Check if sym links are supported
         try {
-            link.createSymbolicLink(Path.get("foo"));
+            link.createSymbolicLink(Paths.get("foo"));
             link.delete(true);
         } catch (UnsupportedOperationException x) {
             // sym links not supported
@@ -68,7 +68,7 @@
 
         String[] targets = (isWindows) ? windowsTargets : otherTargets;
         for (String s: targets) {
-            Path target = Path.get(s);
+            Path target = Paths.get(s);
             link.createSymbolicLink(target);
             try {
                 assertTrue(link.readSymbolicLink().equals(target));
--- a/test/java/nio/file/Path/Misc.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/file/Path/Misc.java	Tue Jul 22 11:58:11 2008 +0100
@@ -65,8 +65,8 @@
      */
     static void equalsAndHashCode() {
 
-        Path thisFile = Path.get("this");
-        Path thatFile = Path.get("that");
+        Path thisFile = Paths.get("this");
+        Path thatFile = Paths.get("that");
 
         assertTrue(thisFile.equals(thisFile));
         assertTrue(!thisFile.equals(thatFile));
@@ -74,7 +74,7 @@
         assertTrue(!thisFile.equals(null));
         assertTrue(!thisFile.equals(new Object()));
 
-        Path likeThis = Path.get("This");
+        Path likeThis = Paths.get("This");
         if (isWindows) {
             // case insensitive
             assertTrue(thisFile.equals(likeThis));
@@ -127,7 +127,7 @@
          * Test: Edit ACL to deny WRITE and EXECUTE
          */
         AclFileAttributeView view = file
-            .newFileAttributeView(AclFileAttributeView.class, true);
+            .getFileAttributeView(AclFileAttributeView.class, true);
         if (view != null &&
             file.getFileStore().supportsFileAttributeView(AclFileAttributeView.class))
         {
@@ -167,7 +167,7 @@
          */
         if (isWindows) {
             DosFileAttributeView dview =
-                file.newFileAttributeView(DosFileAttributeView.class, true);
+                file.getFileAttributeView(DosFileAttributeView.class, true);
             dview.setReadOnly(true);
             try {
                 file.checkAccess(Access.WRITE);
@@ -177,7 +177,7 @@
             dview.setReadOnly(false);
 
             // Read-only attribute does not make direcory read-only
-            dview.bind(dir);
+            dview = dir.getFileAttributeView(DosFileAttributeView.class, true);
             boolean save = dview.readAttributes().isReadOnly();
             dview.setReadOnly(true);
             dir.checkAccess(Access.WRITE);
--- a/test/java/nio/file/Path/UriImportExport.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/file/Path/UriImportExport.java	Tue Jul 22 11:58:11 2008 +0100
@@ -38,7 +38,7 @@
 
     static void test(String fn, String expected) {
         log.println();
-        Path p = Path.get(fn);
+        Path p = Paths.get(fn);
         log.println(p);
         URI u = p.toUri();
         log.println("  --> " + u);
@@ -47,7 +47,7 @@
             failures++;
             return;
         }
-        Path q = Path.get(u);
+        Path q = Paths.get(u);
         log.println("  --> " + q);
         if (!p.toAbsolutePath().equals(q)) {
             log.println("FAIL: Expected " + p + ", got " + q);
--- a/test/java/nio/file/TestUtil.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/file/TestUtil.java	Tue Jul 22 11:58:11 2008 +0100
@@ -31,7 +31,7 @@
     }
 
     public static Path createTemporaryDirectory() throws IOException {
-        Path tmpdir = Path.get(System.getProperty("java.io.tmpdir"));
+        Path tmpdir = Paths.get(System.getProperty("java.io.tmpdir"));
         Random r = new Random();
 
         Path dir;
--- a/test/java/nio/file/attribute/AclFileAttributeView/Basic.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/file/attribute/AclFileAttributeView/Basic.java	Tue Jul 22 11:58:11 2008 +0100
@@ -49,7 +49,7 @@
             file.createFile();
 
         AclFileAttributeView view = file
-            .newFileAttributeView(AclFileAttributeView.class, true);
+            .getFileAttributeView(AclFileAttributeView.class, true);
 
         // print existing ACL
         List<AclEntry> acl = view.getAcl();
@@ -78,7 +78,8 @@
 
         // if PosixFileAttributeView then repeat test with OWNER@
         if (file.getFileStore().supportsFileAttributeView(PosixFileAttributeView.class)) {
-            owner = view.lookupPrincipalByName("OWNER@");
+            owner = file.getFileSystem().getUserPrincipalLookupService()
+                .lookupPrincipalByName("OWNER@");
             entry = AclEntry.newBuilder(entry).setPrincipal(owner).build();
 
             System.out.println(" -- replace (entry 0) --");
--- a/test/java/nio/file/attribute/BasicFileAttributeView/Basic.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/file/attribute/BasicFileAttributeView/Basic.java	Tue Jul 22 11:58:11 2008 +0100
@@ -79,7 +79,7 @@
         // copy last-modified time and file create time from directory to file,
         // re-read attribtues, and check they match
         BasicFileAttributeView view =
-            file.newFileAttributeView(BasicFileAttributeView.class, true);
+            file.getFileAttributeView(BasicFileAttributeView.class, true);
         BasicFileAttributes dirAttrs = Attributes.readBasicFileAttributes(dir, true);
         view.setTimes(dirAttrs.lastModifiedTime(), null, null, dirAttrs.resolution());
         if (dirAttrs.creationTime() != -1L) {
@@ -137,38 +137,7 @@
         checkAttributesOfLink(link);
     }
 
-    static void notBoundTests() throws IOException {
-        BasicFileAttributeView view = FileSystems.getDefault()
-            .newFileAttributeView(BasicFileAttributeView.class);
-        try {
-            view.readAttributes();
-            throw new RuntimeException("IllegalStateException not thrown");
-        } catch (IllegalStateException x) {
-        }
-        view.bind(null);
-        try {
-            view.readAttributes();
-            throw new RuntimeException("IllegalStateException not thrown");
-        } catch (IllegalStateException x) {
-        }
-        view.bind(null, true);
-        try {
-            view.readAttributes();
-            throw new RuntimeException("IllegalStateException not thrown");
-        } catch (IllegalStateException x) {
-        }
-        view.bind(null, false);
-        try {
-            view.readAttributes();
-            throw new RuntimeException("IllegalStateException not thrown");
-        } catch (IllegalStateException x) {
-        }
-    }
-
     public static void main(String[] args) throws IOException {
-        // check for IllegalStateException
-        notBoundTests();
-
         // create temporary directory to run tests
         Path dir = TestUtil.createTemporaryDirectory();
         try {
--- a/test/java/nio/file/attribute/DosFileAttributeView/Basic.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/file/attribute/DosFileAttributeView/Basic.java	Tue Jul 22 11:58:11 2008 +0100
@@ -68,9 +68,8 @@
         Path file = dir.resolve("foo");
         file.newOutputStream().close();
         try {
-            DosFileAttributeView view =
-                file.newFileAttributeView(DosFileAttributeView.class, true);
-            testAttributes(view);
+            testAttributes(file
+                .getFileAttributeView(DosFileAttributeView.class, true));
 
             // Following tests use a symbolic link so skip if not supported
             if (!TestUtil.supportsLinks(dir))
@@ -78,15 +77,15 @@
 
             Path link = dir.resolve("link").createSymbolicLink(file);
 
-            DosFileAttributes attrs;
-
             // test following links
-            testAttributes(view.bind(link, true));
+            testAttributes(link
+                .getFileAttributeView(DosFileAttributeView.class, true));
 
             // test not following links
             try {
                 try {
-                    testAttributes(view.bind(link, false));
+                    testAttributes(link
+                        .getFileAttributeView(DosFileAttributeView.class, false));
                 } catch (IOException x) {
                     // access to link attributes not supported
                     return;
@@ -95,26 +94,32 @@
                 // set all attributes on link
                 // run test on target of link (which leaves them all un-set)
                 // check that attributes of link remain all set
-                setAll(view.bind(link, false), true);
-                testAttributes(view.bind(link, true));
-                attrs = view.bind(link, false).readAttributes();
+                setAll(link
+                    .getFileAttributeView(DosFileAttributeView.class, false), true);
+                testAttributes(link
+                    .getFileAttributeView(DosFileAttributeView.class, true));
+                DosFileAttributes attrs = Attributes.readDosFileAttributes(link, false);
                 check(attrs.isReadOnly());
                 check(attrs.isHidden());
                 check(attrs.isArchive());
                 check(attrs.isSystem());
-                setAll(view, false);
+                setAll(link
+                    .getFileAttributeView(DosFileAttributeView.class, false), false);
 
                 // set all attributes on target
                 // run test on link (which leaves them all un-set)
                 // check that attributes of target remain all set
-                setAll(view.bind(link, true), true);
-                testAttributes(view.bind(link, false));
-                attrs = view.bind(link, true).readAttributes();
+                setAll(link
+                    .getFileAttributeView(DosFileAttributeView.class, true), true);
+                testAttributes(link
+                    .getFileAttributeView(DosFileAttributeView.class, false));
+                attrs = Attributes.readDosFileAttributes(link, false);
                 check(attrs.isReadOnly());
                 check(attrs.isHidden());
                 check(attrs.isArchive());
                 check(attrs.isSystem());
-                setAll(view, false);
+                setAll(link
+                    .getFileAttributeView(DosFileAttributeView.class, true), false);
             } finally {
                 link.delete(false);
             }
@@ -123,34 +128,6 @@
         }
     }
 
-    static void notBoundTests() throws IOException {
-        DosFileAttributeView view = FileSystems.getDefault()
-            .newFileAttributeView(DosFileAttributeView.class);
-        try {
-            view.readAttributes();
-            throw new RuntimeException("AttributeViewNotBound not thrown");
-        } catch (IllegalStateException x) {
-        }
-        view.bind(null);
-        try {
-            view.readAttributes();
-            throw new RuntimeException("AttributeViewNotBound not thrown");
-        } catch (IllegalStateException x) {
-        }
-        view.bind(null, true);
-        try {
-            view.readAttributes();
-            throw new RuntimeException("AttributeViewNotBound not thrown");
-        } catch (IllegalStateException x) {
-        }
-        view.bind(null, false);
-        try {
-            view.readAttributes();
-            throw new RuntimeException("AttributeViewNotBound not thrown");
-        } catch (IllegalStateException x) {
-        }
-    }
-
     public static void main(String[] args) throws IOException {
         // create temporary directory to run tests
         Path dir = TestUtil.createTemporaryDirectory();
@@ -161,7 +138,6 @@
                 System.out.println("DOS file attribute not supported.");
                 return;
             }
-            notBoundTests();
             readWriteTests(dir);
         } finally {
             TestUtil.removeAll(dir);
--- a/test/java/nio/file/attribute/FileStoreSpaceAttributeView/Basic.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/file/attribute/FileStoreSpaceAttributeView/Basic.java	Tue Jul 22 11:58:11 2008 +0100
@@ -48,7 +48,7 @@
      */
     static void printFileStore(FileStore fs) throws IOException {
         FileStoreSpaceAttributeView view =
-            fs.newFileStoreAttributeView(FileStoreSpaceAttributeView.class);
+            fs.getFileStoreAttributeView(FileStoreSpaceAttributeView.class);
         FileStoreSpaceAttributes attrs = view.readAttributes();
 
         long total = attrs.totalSpace() / K;
@@ -94,7 +94,7 @@
 
         // get values reported by the FileStoreSpaceAttributeView
         FileStoreSpaceAttributes attrs = fs
-            .newFileStoreAttributeView(FileStoreSpaceAttributeView.class)
+            .getFileStoreAttributeView(FileStoreSpaceAttributeView.class)
             .readAttributes();
         System.out.println("java.nio.file.FileStoreSpaceAttributeView:");
         System.out.format("    Total: %d\n", attrs.totalSpace());
--- a/test/java/nio/file/attribute/NamedAttributeView/Basic.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/file/attribute/NamedAttributeView/Basic.java	Tue Jul 22 11:58:11 2008 +0100
@@ -55,7 +55,7 @@
 
     static void test(Path file, boolean followLinks) throws IOException {
         NamedAttributeView view = file
-            .newFileAttributeView(NamedAttributeView.class, followLinks);
+            .getFileAttributeView(NamedAttributeView.class, followLinks);
         ByteBuffer buf = rand.nextBoolean() ?
             ByteBuffer.allocate(100) : ByteBuffer.allocateDirect(100);
 
@@ -123,7 +123,7 @@
 
     static void miscTests(Path file) throws IOException {
         NamedAttributeView view = file
-            .newFileAttributeView(NamedAttributeView.class, true);
+            .getFileAttributeView(NamedAttributeView.class, true);
         view.write(ATTR_NAME, ByteBuffer.wrap(ATTR_VALUE.getBytes()));
 
         // NullPointerException
--- a/test/java/nio/file/attribute/PosixFileAttributeView/Basic.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/file/attribute/PosixFileAttributeView/Basic.java	Tue Jul 22 11:58:11 2008 +0100
@@ -102,14 +102,14 @@
      * mode that is not less secure
      */
     static void createWithPermissions(Path file,
-                                      PosixFileAttributeView view,
                                       String mode)
         throws IOException
     {
         Set<PosixFilePermission> requested = toPermissions(mode);
-        Attribute<Set<PosixFilePermission>> attr = view.newPermissionsAttribute()
+        Attribute<Set<PosixFilePermission>> attr = file
+            .getFileAttributeView(PosixFileAttributeView.class, true)
+            .newPermissionsAttribute()
             .setValue(requested);
-
         System.out.format("create file with mode: %s\n", mode);
 
         EnumSet<StandardOpenOption> options = EnumSet.of(StandardOpenOption.CREATE_NEW,
@@ -117,7 +117,7 @@
         file.newOutputStream(options, attr).close();
         try {
             checkSecure(requested,  file
-                .newFileAttributeView(PosixFileAttributeView.class, true)
+                .getFileAttributeView(PosixFileAttributeView.class, true)
                 .readAttributes()
                 .permissions());
         } finally {
@@ -128,7 +128,7 @@
         file.createDirectory(attr);
         try {
             checkSecure(requested,  file
-                .newFileAttributeView(PosixFileAttributeView.class, true)
+                .getFileAttributeView(PosixFileAttributeView.class, true)
                 .readAttributes()
                 .permissions());
         } finally {
@@ -139,7 +139,7 @@
     /**
      * Test the setPermissions/permissions methods.
      */
-    static void permissionTests(PosixFileAttributeView view, Path dir)
+    static void permissionTests(Path dir)
         throws IOException
     {
         System.out.println("-- Permission Tests  --");
@@ -150,8 +150,10 @@
         file.newOutputStream().close();
         try {
             // get initial permissions so that we can restore them later
-            view.bind(file, true);
-            Set<PosixFilePermission> save = view.readAttributes().permissions();
+            PosixFileAttributeView view = file
+                .getFileAttributeView(PosixFileAttributeView.class, true);
+            Set<PosixFilePermission> save = view.readAttributes()
+                .permissions();
 
             // test various modes
             try {
@@ -190,7 +192,8 @@
             System.out.format("create link %s\n", link);
             link.createSymbolicLink(file);
             try {
-                PosixFileAttributes attrs = view.bind(link, false).readAttributes();
+                PosixFileAttributes attrs = Attributes
+                    .readPosixFileAttributes(link, false);
                 if (!attrs.isSymbolicLink()) {
                     throw new RuntimeException("not a link");
                 }
@@ -205,36 +208,34 @@
     /**
      * Test creating a file and directory with initial permissios
      */
-    static void createTests(PosixFileAttributeView view, Path dir)
+    static void createTests(Path dir)
         throws IOException
     {
         System.out.println("-- Create Tests  --");
 
         Path file = dir.resolve("foo");
-        // view not required to be bound to create Attribute
-        view.bind(null);
 
-        createWithPermissions(file, view, "---------");
-        createWithPermissions(file, view, "r--------");
-        createWithPermissions(file, view, "-w-------");
-        createWithPermissions(file, view, "--x------");
-        createWithPermissions(file, view, "rwx------");
-        createWithPermissions(file, view, "---r-----");
-        createWithPermissions(file, view, "----w----");
-        createWithPermissions(file, view, "-----x---");
-        createWithPermissions(file, view, "---rwx---");
-        createWithPermissions(file, view, "------r--");
-        createWithPermissions(file, view, "-------w-");
-        createWithPermissions(file, view, "--------x");
-        createWithPermissions(file, view, "------rwx");
-        createWithPermissions(file, view, "r--r-----");
-        createWithPermissions(file, view, "r--r--r--");
-        createWithPermissions(file, view, "rw-rw----");
-        createWithPermissions(file, view, "rwxrwx---");
-        createWithPermissions(file, view, "rw-rw-r--");
-        createWithPermissions(file, view, "r-xr-x---");
-        createWithPermissions(file, view, "r-xr-xr-x");
-        createWithPermissions(file, view, "rwxrwxrwx");
+        createWithPermissions(file, "---------");
+        createWithPermissions(file, "r--------");
+        createWithPermissions(file, "-w-------");
+        createWithPermissions(file, "--x------");
+        createWithPermissions(file, "rwx------");
+        createWithPermissions(file, "---r-----");
+        createWithPermissions(file, "----w----");
+        createWithPermissions(file, "-----x---");
+        createWithPermissions(file, "---rwx---");
+        createWithPermissions(file, "------r--");
+        createWithPermissions(file, "-------w-");
+        createWithPermissions(file, "--------x");
+        createWithPermissions(file, "------rwx");
+        createWithPermissions(file, "r--r-----");
+        createWithPermissions(file, "r--r--r--");
+        createWithPermissions(file, "rw-rw----");
+        createWithPermissions(file, "rwxrwx---");
+        createWithPermissions(file, "rw-rw-r--");
+        createWithPermissions(file, "r-xr-x---");
+        createWithPermissions(file, "r-xr-xr-x");
+        createWithPermissions(file, "rwxrwxrwx");
 
         System.out.println("OKAY");
     }
@@ -243,7 +244,7 @@
      * Test setOwner/setGroup methods - this test simpler exercises the
      * methods to avoid configuration.
      */
-    static void ownerTests(PosixFileAttributeView view, Path dir)
+    static void ownerTests(Path dir)
         throws IOException
     {
         System.out.println("-- Owner Tests  --");
@@ -255,7 +256,9 @@
         try {
 
             // read attributes of directory to get owner/group
-            PosixFileAttributes attrs = view.bind(file).readAttributes();
+            PosixFileAttributeView view = file
+                .getFileAttributeView(PosixFileAttributeView.class, true);
+            PosixFileAttributes attrs = view.readAttributes();
 
             // set to existing owner/group
             view.setOwner(attrs.owner()).setGroup(attrs.group());
@@ -282,18 +285,21 @@
     /**
      * Test the lookupPrincipalByName/lookupPrincipalByGroupName methods
      */
-    static void lookupPrincipalTests(PosixFileAttributeView view, FileRef dir)
+    static void lookupPrincipalTests(Path dir)
         throws IOException
     {
         System.out.println("-- Lookup UserPrincipal Tests --");
 
+        UserPrincipalLookupService lookupService = dir.getFileSystem()
+            .getUserPrincipalLookupService();
+
         // read attributes of directory to get owner/group
-        PosixFileAttributes attrs = view.bind(dir).readAttributes();
+        PosixFileAttributes attrs = Attributes.readPosixFileAttributes(dir, true);
 
         // lookup owner and check it matches file's owner
         System.out.format("lookup: %s\n", attrs.owner().getName());
         try {
-            UserPrincipal owner = view.lookupPrincipalByName(attrs.owner().getName());
+            UserPrincipal owner = lookupService.lookupPrincipalByName(attrs.owner().getName());
             if (owner.isGroup())
                 throw new RuntimeException("owner is a group?");
             if (!owner.equals(attrs.owner()))
@@ -305,7 +311,7 @@
         // lookup group and check it matches file's group-owner
         System.out.format("lookup group: %s\n", attrs.group().getName());
         try {
-            UserPrincipal group = view.lookupPrincipalByGroupName(attrs.group().getName());
+            UserPrincipal group = lookupService.lookupPrincipalByGroupName(attrs.group().getName());
             if (!group.isGroup())
                 throw new RuntimeException("group is not a group?");
             if (!group.equals(attrs.group()))
@@ -318,13 +324,13 @@
         String invalidPrincipal = "scumbag99";
         try {
             System.out.format("lookup: %s\n", invalidPrincipal);
-            view.lookupPrincipalByName(invalidPrincipal);
+            lookupService.lookupPrincipalByName(invalidPrincipal);
             throw new RuntimeException("'" + invalidPrincipal + "' is a valid user?");
         } catch (UserPrincipalNotFoundException x) {
         }
         try {
             System.out.format("lookup group: %s\n", invalidPrincipal);
-            view.lookupPrincipalByGroupName("idonotexist");
+            lookupService.lookupPrincipalByGroupName("idonotexist");
             throw new RuntimeException("'" + invalidPrincipal + "' is a valid group?");
         } catch (UserPrincipalNotFoundException x) {
         }
@@ -335,38 +341,13 @@
      * Test various exceptions are thrown as expected
      */
     @SuppressWarnings("unchecked")
-    static void exceptionsTests(FileRef dir, PosixFileAttributeView view)
+    static void exceptionsTests(Path dir)
         throws IOException
     {
         System.out.println("-- Exceptions --");
 
-        // IllegalStateException
-        view.bind(null);
-        try {
-            view.readAttributes();
-            throw new RuntimeException("IllegalState not thrown");
-        } catch (IllegalStateException x) {
-        }
-        view.bind(null);
-        try {
-            view.readAttributes();
-            throw new RuntimeException("IllegalState not thrown");
-        } catch (IllegalStateException x) {
-        }
-        try {
-            view.readAttributes();
-            throw new RuntimeException("IllegalState not thrown");
-        } catch (IllegalStateException x) {
-        }
-        view.bind(null, false);
-        try {
-            view.readAttributes();
-            throw new RuntimeException("IllegalState not thrown");
-        } catch (IllegalStateException x) {
-        }
-
-        // bind view as following methods may throw IllegalStateException
-        view.bind(dir);
+        PosixFileAttributeView view = dir
+            .getFileAttributeView(PosixFileAttributeView.class, true);
 
         // NullPointerException
         try {
@@ -379,13 +360,16 @@
             throw new RuntimeException("NullPointerException not thrown");
         } catch (NullPointerException x) {
         }
+
+        UserPrincipalLookupService lookupService = dir.getFileSystem()
+            .getUserPrincipalLookupService();
         try {
-            view.lookupPrincipalByName(null);
+            lookupService.lookupPrincipalByName(null);
             throw new RuntimeException("NullPointerException not thrown");
         } catch (NullPointerException x) {
         }
         try {
-            view.lookupPrincipalByGroupName(null);
+            lookupService.lookupPrincipalByGroupName(null);
             throw new RuntimeException("NullPointerException not thrown");
         } catch (NullPointerException x) {
         }
@@ -416,9 +400,16 @@
 
     public static void main(String[] args) throws IOException {
         // skip test if PosixFileAttributeView not supported
-        PosixFileAttributeView view = FileSystems.getDefault()
-            .newFileAttributeView(PosixFileAttributeView.class);
-        if (view == null) {
+        boolean found = false;
+        for (Class<? extends FileAttributeView> view:
+            FileSystems.getDefault().getFileAttributeViews())
+        {
+            if (view == PosixFileAttributeView.class) {
+                found = true;
+                break;
+            }
+        }
+        if (!found) {
             System.out.println("PosixFileAttributeView not supported");
             return;
         }
@@ -426,11 +417,11 @@
         Path dir = TestUtil.createTemporaryDirectory();
         try {
 
-            permissionTests(view, dir);
-            createTests(view, dir);
-            ownerTests(view, dir);
-            lookupPrincipalTests(view, dir);
-            exceptionsTests(dir, view);
+            permissionTests(dir);
+            createTests(dir);
+            ownerTests(dir);
+            lookupPrincipalTests(dir);
+            exceptionsTests(dir);
 
         } finally {
             TestUtil.removeAll(dir);
--- a/test/java/nio/file/spi/TestProvider.java	Tue Jul 22 10:22:21 2008 +0100
+++ b/test/java/nio/file/spi/TestProvider.java	Tue Jul 22 11:58:11 2008 +0100
@@ -105,11 +105,6 @@
         }
 
         @Override
-        public <V extends FileAttributeView> V newFileAttributeView(Class<V> viewType) {
-            throw new RuntimeException("not implemented");
-        }
-
-        @Override
         public Path getPath(String path) {
             throw new RuntimeException("not implemented");
         }
@@ -120,6 +115,11 @@
         }
 
         @Override
+        public UserPrincipalLookupService getUserPrincipalLookupService() {
+            throw new RuntimeException("not implemented");
+        }
+
+        @Override
         public WatchService newWatchService() throws IOException {
             throw new RuntimeException("not implemented");
         }