src/solaris/classes/sun/nio/fs/UnixSecureDirectoryStream.java
Print this page
*** 79,102 ****
if (!(obj instanceof UnixPath))
throw new ProviderMismatchException();
return (UnixPath)obj;
}
- private boolean followLinks(LinkOption... options) {
- boolean followLinks = true;
- for (LinkOption option: options) {
- if (option == LinkOption.NOFOLLOW_LINKS) {
- followLinks = false;
- continue;
- }
- if (option == null)
- throw new NullPointerException();
- throw new AssertionError("Should not get here");
- }
- return followLinks;
- }
-
/**
* Opens sub-directory in this directory
*/
@Override
public SecureDirectoryStream<Path> newDirectoryStream(Path obj,
--- 79,88 ----
*** 103,113 ****
LinkOption... options)
throws IOException
{
UnixPath file = getName(obj);
UnixPath child = ds.directory().resolve(file);
! boolean followLinks = followLinks(options);
// permission check using name resolved against original path of directory
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
child.checkRead();
--- 89,99 ----
LinkOption... options)
throws IOException
{
UnixPath file = getName(obj);
UnixPath child = ds.directory().resolve(file);
! boolean followLinks = Util.followLinks(options);
// permission check using name resolved against original path of directory
SecurityManager sm = System.getSecurityManager();
if (sm != null) {
child.checkRead();
*** 314,324 ****
public <V extends FileAttributeView> V getFileAttributeView(Path obj,
Class<V> type,
LinkOption... options)
{
UnixPath file = getName(obj);
! boolean followLinks = followLinks(options);
return getFileAttributeViewImpl(file, type, followLinks);
}
/**
* A BasicFileAttributeView implementation that using a dfd/name pair.
--- 300,310 ----
public <V extends FileAttributeView> V getFileAttributeView(Path obj,
Class<V> type,
LinkOption... options)
{
UnixPath file = getName(obj);
! boolean followLinks = Util.followLinks(options);
return getFileAttributeViewImpl(file, type, followLinks);
}
/**
* A BasicFileAttributeView implementation that using a dfd/name pair.