author | serb |
Tue, 12 Nov 2013 20:24:25 +0400 | |
changeset 21596 | 0e3a39f29dbc |
parent 1840 | 984ba55ac827 |
child 23010 | 6dadb192ad81 |
permissions | -rw-r--r-- |
21596 | 1 |
/* |
2 |
* Copyright (c) 2008, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
*/ |
|
23 |
||
1840
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
24 |
/* @test %W% %E% |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
25 |
@bug 6698013 |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
26 |
@summary JFileChooser can no longer navigate non-local file systems. |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
27 |
@author Pavel Porvatov |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
28 |
@run applet/manual=done bug6698013.html |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
29 |
*/ |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
30 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
31 |
import javax.swing.*; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
32 |
import javax.swing.filechooser.FileSystemView; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
33 |
import java.io.File; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
34 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
35 |
public class bug6698013 extends JApplet { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
36 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
37 |
final static VirtualFile root = new VirtualFile("testdir", true); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
38 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
39 |
final static VirtualFile rootFile = new VirtualFile("testdir/test.txt", false); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
40 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
41 |
final static VirtualFile subdir = new VirtualFile("testdir/subdir", true); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
42 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
43 |
final static VirtualFile subdirFile = new VirtualFile("testdir/subdir/subtest.txt", false); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
44 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
45 |
public static void main(String[] args) { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
46 |
JFileChooser chooser = new JFileChooser(new VirtualFileSystemView()); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
47 |
chooser.setCurrentDirectory(root); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
48 |
chooser.showSaveDialog(null); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
49 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
50 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
51 |
public void init() { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
52 |
JFileChooser chooser = new JFileChooser(new VirtualFileSystemView()); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
53 |
chooser.setCurrentDirectory(root); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
54 |
chooser.showSaveDialog(null); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
55 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
56 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
57 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
58 |
class VirtualFileSystemView extends FileSystemView { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
59 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
60 |
public boolean isRoot(File dir) { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
61 |
return bug6698013.root.equals(dir); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
62 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
63 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
64 |
public File createNewFolder(File dir) { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
65 |
return null; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
66 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
67 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
68 |
public File[] getRoots() { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
69 |
return new File[]{bug6698013.root}; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
70 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
71 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
72 |
public boolean isDrive(File dir) { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
73 |
return false; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
74 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
75 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
76 |
public boolean isFloppyDrive(File dir) { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
77 |
return false; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
78 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
79 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
80 |
public File getParentDirectory(File dir) { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
81 |
if (dir == null) { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
82 |
return null; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
83 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
84 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
85 |
return new VirtualFile(dir.getPath(), true).getParentFile(); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
86 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
87 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
88 |
public File[] getFiles(File dir, boolean hide_hidden) { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
89 |
if (dir.equals(bug6698013.root)) { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
90 |
return new File[]{bug6698013.rootFile, bug6698013.subdir}; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
91 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
92 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
93 |
if (dir.equals(bug6698013.subdir)) { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
94 |
return new File[]{bug6698013.subdirFile}; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
95 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
96 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
97 |
return null; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
98 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
99 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
100 |
public File getHomeDirectory() { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
101 |
return bug6698013.root; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
102 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
103 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
104 |
public File getDefaultDirectory() { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
105 |
return getHomeDirectory(); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
106 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
107 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
108 |
public String getSystemDisplayName(File file) { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
109 |
return file.getName(); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
110 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
111 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
112 |
public Boolean isTraversable(File file) { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
113 |
return Boolean.valueOf(file.isDirectory()); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
114 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
115 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
116 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
117 |
/** |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
118 |
* A Virtual File. Contains a path and a directory flag that |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
119 |
* represents the location of a virtual file to be contained in the |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
120 |
* Virtual FileSystemView. |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
121 |
*/ |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
122 |
class VirtualFile extends File { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
123 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
124 |
private static final long serialVersionUID = 0L; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
125 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
126 |
private String path; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
127 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
128 |
private boolean directory; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
129 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
130 |
public VirtualFile(String path, boolean directory) { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
131 |
super(path); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
132 |
this.path = path; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
133 |
this.directory = directory; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
134 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
135 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
136 |
public File getParentFile() { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
137 |
int index = path.lastIndexOf('/'); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
138 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
139 |
if (index == -1) { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
140 |
return null; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
141 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
142 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
143 |
return new VirtualFile(path.substring(0, index), true); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
144 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
145 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
146 |
public File getCanonicalFile() { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
147 |
return this; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
148 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
149 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
150 |
public String getParent() { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
151 |
File parent_file = getParentFile(); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
152 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
153 |
return parent_file == null ? null : parent_file.getPath(); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
154 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
155 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
156 |
public String getName() { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
157 |
int index = path.lastIndexOf('/'); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
158 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
159 |
return index == -1 ? path : path.substring(index + 1); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
160 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
161 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
162 |
public String getPath() { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
163 |
return path; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
164 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
165 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
166 |
public String getAbsolutePath() { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
167 |
return path; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
168 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
169 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
170 |
public String getCanonicalPath() { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
171 |
return path; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
172 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
173 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
174 |
public String toString() { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
175 |
return path; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
176 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
177 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
178 |
public boolean equals(Object obj) { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
179 |
return obj instanceof VirtualFile && path.equals(obj.toString()); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
180 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
181 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
182 |
public int hashCode() { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
183 |
return path.hashCode(); |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
184 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
185 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
186 |
public boolean canWrite() { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
187 |
return true; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
188 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
189 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
190 |
public boolean isDirectory() { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
191 |
return directory; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
192 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
193 |
|
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
194 |
public boolean exists() { |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
195 |
return true; |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
196 |
} |
984ba55ac827
6698013: JFileChooser can no longer navigate non-local file systems.
rupashka
parents:
diff
changeset
|
197 |
} |