blob: 32f52c4494bbe4707b1145ee8e56eca298206d18 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
--- openjdk/jdk/src/share/classes/sun/awt/shell/ShellFolder.java 2016-10-19 11:41:05.669056845 +0530
+++ openjdk/jdk/src/share/classes/sun/awt/shell/ShellFolder.java 2016-10-19 11:44:37.957056845 +0530
@@ -30,6 +30,10 @@
import java.awt.Toolkit;
import java.io.*;
import java.io.FileNotFoundException;
+import java.nio.file.Files;
+import java.nio.file.LinkOption;
+import java.nio.file.Path;
+import java.nio.file.Paths;
import java.util.*;
import java.util.concurrent.Callable;
@@ -240,10 +244,11 @@
* @exception FileNotFoundException if file does not exist
*/
public static ShellFolder getShellFolder(File file) throws FileNotFoundException {
+ Path path = Paths.get(file.getPath());
if (file instanceof ShellFolder) {
return (ShellFolder)file;
}
- if (!file.exists()) {
+ if (!Files.exists(path, LinkOption.NOFOLLOW_LINKS)) {
throw new FileNotFoundException();
}
return shellFolderManager.createShellFolder(file);
|