src/solaris/classes/sun/nio/fs/UnixPath.java
Print this page
*** 817,842 ****
return new UnixPath(getFileSystem(),
resolve(getFileSystem().defaultDirectory(), path));
}
@Override
! public Path toRealPath(boolean resolveLinks) throws IOException {
checkRead();
UnixPath absolute = toAbsolutePath();
! // if resolveLinks is true then use realpath
! if (resolveLinks) {
try {
byte[] rp = realpath(absolute);
return new UnixPath(getFileSystem(), rp);
} catch (UnixException x) {
x.rethrowAsIOException(this);
}
}
! // if resolveLinks is false then eliminate "." and also ".."
// where the previous element is not a link.
UnixPath result = fs.rootDirectory();
for (int i=0; i<absolute.getNameCount(); i++) {
UnixPath element = absolute.getName(i);
--- 817,842 ----
return new UnixPath(getFileSystem(),
resolve(getFileSystem().defaultDirectory(), path));
}
@Override
! public Path toRealPath(LinkOption... options) throws IOException {
checkRead();
UnixPath absolute = toAbsolutePath();
! // if resolving links then use realpath
! if (Util.followLinks(options)) {
try {
byte[] rp = realpath(absolute);
return new UnixPath(getFileSystem(), rp);
} catch (UnixException x) {
x.rethrowAsIOException(this);
}
}
! // if not resolving links then eliminate "." and also ".."
// where the previous element is not a link.
UnixPath result = fs.rootDirectory();
for (int i=0; i<absolute.getNameCount(); i++) {
UnixPath element = absolute.getName(i);