提交 0d224224 编写于 作者: V vikram

7012783: JFileChooser fails to resolve DFS links on Windows Vista SP2

Summary: Changes to code to handle DFS links
Reviewed-by: rupashka
上级 e655854a
...@@ -1153,10 +1153,15 @@ public class BasicFileChooserUI extends FileChooserUI { ...@@ -1153,10 +1153,15 @@ public class BasicFileChooserUI extends FileChooserUI {
if (shellFolder.isLink()) { if (shellFolder.isLink()) {
File linkedTo = shellFolder.getLinkLocation(); File linkedTo = shellFolder.getLinkLocation();
if (linkedTo != null && fc.isTraversable(linkedTo)) { // If linkedTo is null we try to use dir
dir = linkedTo; if (linkedTo != null) {
if (fc.isTraversable(linkedTo)) {
dir = linkedTo;
} else {
return;
}
} else { } else {
return; dir = shellFolder;
} }
} }
} catch (FileNotFoundException ex) { } catch (FileNotFoundException ex) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册