-
Bug
-
Resolution: Duplicate
-
P3
-
None
-
1.4.0
-
x86
-
windows_nt
Name: dsR10051 Date: 05/30/2001
The behavior of methods
File javax.swing.filechooser.FileSystemView.createFileSystemRoot(File f)
and public boolean isFileSystemRoot(File dir) do not match each others.
Under Windows platform createFileSystemRoot method returns file
for which isFileSystemRoot returns false.
Here is minimized test:
import javax.swing.filechooser.*;
import java.io.*;
public class FileSystemViewTest02 {
public static void main(String[] args) {
MyFileSystemView fsv = new MyFileSystemView();
File file = new File("");
File f = fsv.createFileSystemRoot(file);
System.out.println(f);
System.out.println(fsv.isFileSystemRoot(f));
}
}
class MyFileSystemView extends FileSystemView {
public File createNewFolder (File f) throws IOException {
System.out.println("createNewFolder called");
return null;
}
public File createFileSystemRoot(File f) {
return super.createFileSystemRoot(f);
}
}
--- Output ---
C:\user\sda\bin>set CLASSPATH=.
C:\user\sda\bin>N:\JDK1.4.0beta-b65\win32\bin\java FileSystemViewTest02
false
======================================================================