diff -r d31b7cc371ef -r 77d9c0f1c19f jdk/src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java --- a/jdk/src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java Thu Jan 13 22:21:58 2011 -0800 +++ b/jdk/src/solaris/classes/sun/nio/fs/LinuxFileSystemProvider.java Fri Jan 28 09:28:43 2011 +0000 @@ -25,6 +25,10 @@ package sun.nio.fs; +import java.nio.file.*; +import java.nio.file.attribute.*; +import java.io.IOException; + /** * Linux implementation of FileSystemProvider */ @@ -38,4 +42,58 @@ LinuxFileSystem newFileSystem(String dir) { return new LinuxFileSystem(this, dir); } + + @Override + LinuxFileStore getFileStore(UnixPath path) throws IOException { + return new LinuxFileStore(path); + } + + @Override + @SuppressWarnings("unchecked") + public V getFileAttributeView(Path obj, + Class type, + LinkOption... options) + { + if (type == DosFileAttributeView.class) { + return (V) new LinuxDosFileAttributeView(UnixPath.toUnixPath(obj), + followLinks(options)); + } + if (type == UserDefinedFileAttributeView.class) { + return (V) new LinuxUserDefinedFileAttributeView(UnixPath.toUnixPath(obj), + followLinks(options)); + } + return super.getFileAttributeView(obj, type, options); + } + + @Override + public DynamicFileAttributeView getFileAttributeView(Path obj, + String name, + LinkOption... options) + { + if (name.equals("dos")) { + return new LinuxDosFileAttributeView(UnixPath.toUnixPath(obj), + followLinks(options)); + } + if (name.equals("user")) { + return new LinuxUserDefinedFileAttributeView(UnixPath.toUnixPath(obj), + followLinks(options)); + } + return super.getFileAttributeView(obj, name, options); + } + + @Override + @SuppressWarnings("unchecked") + public A readAttributes(Path file, + Class type, + LinkOption... options) + throws IOException + { + if (type == DosFileAttributes.class) { + DosFileAttributeView view = + getFileAttributeView(file, DosFileAttributeView.class, options); + return (A) view.readAttributes(); + } else { + return super.readAttributes(file, type, options); + } + } }