diff options
Diffstat (limited to 'javax/swing/filechooser/FileSystemView.java')
-rw-r--r-- | javax/swing/filechooser/FileSystemView.java | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/javax/swing/filechooser/FileSystemView.java b/javax/swing/filechooser/FileSystemView.java index f51b745c8..84b80dd40 100644 --- a/javax/swing/filechooser/FileSystemView.java +++ b/javax/swing/filechooser/FileSystemView.java @@ -76,7 +76,10 @@ public abstract class FileSystemView */ public File createFileObject(String path) { - return new File(path); + File f = new File(path); + if (isFileSystemRoot(f)) + f = this.createFileSystemRoot(f); + return f; } /** @@ -223,16 +226,24 @@ public abstract class FileSystemView /** * Returns the name of a file as it would be displayed by the underlying - * system. This implementation returns <code>null</code>, subclasses must - * override. + * system. * * @param f the file. * - * @return <code>null</code>. + * @return the name of a file as it would be displayed by the underlying + * system + * + * @specnote The specification suggests that the information here is + * fetched from a ShellFolder class. This seems to be a non public + * private file handling class. We simply return File.getName() + * here and leave special handling to subclasses. */ public String getSystemDisplayName(File f) { - return null; + String name = null; + if (f != null) + name = f.getName(); + return name; } /** |