diff options
author | jfrijters <jfrijters> | 2014-10-29 14:59:05 +0300 |
---|---|---|
committer | jfrijters <jfrijters> | 2014-10-29 14:59:05 +0300 |
commit | 79649ec62faf69a46780b16488a9c4076235b122 (patch) | |
tree | d20e1389b347249d22520275809183f4844128d5 /openjdk | |
parent | ee22a4d1cb6821c74a38c9f996d3e81851f9f919 (diff) |
Fixed regression introduced by previous fix. We can't use FileInfo.Exists, because it should be possible to read directory attributes as well.
Diffstat (limited to 'openjdk')
-rw-r--r-- | openjdk/sun/nio/fs/NetFileSystemProvider.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/openjdk/sun/nio/fs/NetFileSystemProvider.java b/openjdk/sun/nio/fs/NetFileSystemProvider.java index 3a16383c..1f112199 100644 --- a/openjdk/sun/nio/fs/NetFileSystemProvider.java +++ b/openjdk/sun/nio/fs/NetFileSystemProvider.java @@ -1141,7 +1141,10 @@ final class NetFileSystemProvider extends AbstractFileSystemProvider if (false) throw new cli.System.IO.FileNotFoundException(); if (false) throw new cli.System.IO.IOException(); FileInfo info = new FileInfo(path); - if (!info.get_Exists()) + // We have to rely on the (undocumented) fact that FileInfo.Attributes returns -1 + // when the path does not exist. We need this to work for both files and directories + // and this is the only efficient way to do that. + if (info.get_Attributes().Value == -1) { throw new NoSuchFileException(path); } |