diff options
author | jfrijters <jfrijters> | 2014-07-01 18:57:34 +0400 |
---|---|---|
committer | jfrijters <jfrijters> | 2014-07-01 18:57:34 +0400 |
commit | b1978d11757ae9dce10b8398df0b498c604658dd (patch) | |
tree | 0480752d01ac49a7b20f45d0eb0f413c87e6a91c | |
parent | 4f077fd38917bcecfe515032c5d15cab011a828b (diff) |
Bug fix. Calling BasicFileAttributes.size() on a directory didn't work. Thanks to Lucius Junevicus for reporting this.
-rw-r--r-- | openjdk/sun/nio/fs/NetFileSystemProvider.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/openjdk/sun/nio/fs/NetFileSystemProvider.java b/openjdk/sun/nio/fs/NetFileSystemProvider.java index 3c569b1e..11686c3f 100644 --- a/openjdk/sun/nio/fs/NetFileSystemProvider.java +++ b/openjdk/sun/nio/fs/NetFileSystemProvider.java @@ -338,7 +338,7 @@ final class NetFileSystemProvider extends AbstractFileSystemProvider } } - return FileChannelImpl.open(open(npath.path, mode, rights, share, options), npath.path, read, write, append, null); + return FileChannelImpl.open(open(npath.path, mode, rights, share, options), read, write, append, null); } private static FileDescriptor open(String path, int mode, int rights, int share, int options) throws IOException @@ -1104,7 +1104,7 @@ final class NetFileSystemProvider extends AbstractFileSystemProvider public long size() { - return info.get_Length(); + return info.get_Exists() ? info.get_Length() : 0; } public boolean isArchive() |