提交 10bec5ff 编写于 作者: R rupashka

6560349: REGRESSION :folder having ".lnk" in the name can not be opened by 5.0 and later versions

Reviewed-by: alexp
上级 f0684078
...@@ -1134,12 +1134,17 @@ public class BasicFileChooserUI extends FileChooserUI { ...@@ -1134,12 +1134,17 @@ public class BasicFileChooserUI extends FileChooserUI {
// Traverse shortcuts on Windows // Traverse shortcuts on Windows
if (dir != null && FilePane.usesShellFolder(fc)) { if (dir != null && FilePane.usesShellFolder(fc)) {
try { try {
File linkedTo = ShellFolder.getShellFolder(dir).getLinkLocation(); ShellFolder shellFolder = ShellFolder.getShellFolder(dir);
if (shellFolder.isLink()) {
File linkedTo = shellFolder.getLinkLocation();
if (linkedTo != null && fc.isTraversable(linkedTo)) { if (linkedTo != null && fc.isTraversable(linkedTo)) {
dir = linkedTo; dir = linkedTo;
} else { } else {
return; return;
} }
}
} catch (FileNotFoundException ex) { } catch (FileNotFoundException ex) {
return; return;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册