United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6698013 JFileChooser can no longer navigate non-local file systems.
JDK-6698013 : JFileChooser can no longer navigate non-local file systems.

Details
Type:
Bug
Submit Date:
2008-05-06
Status:
Closed
Updated Date:
2011-02-16
Project Name:
JDK
Resolved Date:
2009-05-18
Component:
client-libs
OS:
windows_vista,windows_xp
Sub-Component:
javax.swing
CPU:
x86,generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6,6u4
Fixed Versions:
6u14 (b02)

Related Reports
Backport:
Duplicate:
Duplicate:
Duplicate:
Relates:

Sub Tasks

Description
FULL PRODUCT VERSION :
java version "1.6.0_06"
Java(TM) SE Runtime Environment (build 1.6.0_06-b02)
Java HotSpot(TM) Client VM (build 10.0-b22, mixed mode, sharing)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows XP [Version 5.1.2600]

A DESCRIPTION OF THE PROBLEM :
Our app uses JFileChooser to navigate a variety of non-local file systems (network, FTP, etc) by supplying a FileSystemView object to the chooser.

This worked fine until 1.6.0_04, when a change was made to BasicFileChooserUI.changeDirectory().  The problem occurs when the user opens the chooser and attempts to navigate into one of the displayed folders either by double clicking it, or single-clicking it then clicking the Open button.
The new version of changeDirectory() always calls ShellFolder.getShellFolder(dir) which uses File.getCanonicalFile() to retrieve the canonical path for the file then tests the file to see if it exists. This test is performed using the LOCAL file system and when the test fails it throws an exception and the chooser refuses to navigate into the selected folder.  Of course the test fails, because the folder doesn't exist on the LOCAL file system.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
invoke JFileChooser with a FileSystemView that describes a remote file system.

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
chooser should allows the user to navigate into a selected subfolder
ACTUAL -
chooser does not change directories

ERROR MESSAGES/STACK TRACES THAT OCCUR :
no error message occurs

REPRODUCIBILITY :
This bug can be reproduced always.

CUSTOMER SUBMITTED WORKAROUND :
The only workaround we found was to hard code File.getCanonicalPath() to always return "C:\", this passes the "exists" test and JFileChooser is now permitted to navigate into the folder the user has selected.

Release Regression From : 6u3
The above release value was the last known release where this 
bug was not reproducible. Since then there has been a regression.

                                    

Comments
EVALUATION

The cause is brilliantly discovered by the CR initiator, see Description.
                                     
2008-05-29



Hardware and Software, Engineered to Work Together