Files.newDirectoryStream(Path, LinkOption...)
Alan Bateman
Alan.Bateman at oracle.com
Wed Feb 12 13:50:52 PST 2014
On 12/02/2014 17:45, Colin Decker wrote:
> Why is there no method for opening a DirectoryStream that allows
> NOFOLLOW_LINKS? SecureDirectoryStream has such a method, but
> ironically it isn't possible to get a SecureDirectoryStream in the
> first place without the possibility of following a symbolic link. Any
> number of other methods, including those for reading attributes and
> opening streams/channels, do allow NOFOLLOW_LINKS, so why not
> newDirectoryStream?
This was deliberate at the time to keep the newDirectoryStream methods
simple and because NOFOLLOW_LINKS wasn't widely supported (this is also
why SecureDirectoryStream is not required to be supported). So yes, this
means you will always follow links when obtaining the initial
SecureDirectoryStream. It is probably an area that should be looked at
again in the future although the support for NOFOLLOW_LINKS or
equivalent is still a bit sparse.
-Alan.
More information about the nio-dev
mailing list