Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/ikvm-fork.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjfrijters <jfrijters>2014-10-29 14:59:05 +0300
committerjfrijters <jfrijters>2014-10-29 14:59:05 +0300
commit79649ec62faf69a46780b16488a9c4076235b122 (patch)
treed20e1389b347249d22520275809183f4844128d5 /openjdk
parentee22a4d1cb6821c74a38c9f996d3e81851f9f919 (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.java5
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);
}