8021379: JFileChooser Create New Folder button enabled in write proteced directory
Reviewed-by: alexsch
--- a/jdk/src/share/classes/sun/swing/FilePane.java Tue Aug 27 12:53:46 2013 +0400
+++ b/jdk/src/share/classes/sun/swing/FilePane.java Tue Aug 27 13:13:32 2013 +0400
@@ -1980,18 +1980,18 @@
}
if (f instanceof ShellFolder) {
- return ((ShellFolder) f).isFileSystem();
+ return f.canWrite();
} else {
if (usesShellFolder(getFileChooser())) {
try {
- return ShellFolder.getShellFolder(f).isFileSystem();
+ return ShellFolder.getShellFolder(f).canWrite();
} catch (FileNotFoundException ex) {
// File doesn't exist
return false;
}
} else {
// Ordinary file
- return true;
+ return f.canWrite();
}
}
}