path to windows 7 'libraries' from JFileChooser
I am running windows 7 - 64 bit. Java version is 1.6.0_20.
Our software uses a JFileChooser to display the dialog to create a new file/project. After passing the if statement in the fragment below the user has chosen his file.
if (JFileChooser.APPROVE_OPTION == chooser.showOpenDialog(parentFrame))
File file = chooser.getSelectedFile();
If the user navigated to one of windows 7's new 'libraries' then the path associated with the file that is returned on the next line by the getSelectedFile() method is not a valid path. It looks like:
where sdfg is the filename. This isn't flagged immediately, but the root cause is here. The new windows 7 libraries are not filesystem locations, but some sort of reference (although they appear in the filesystem), so I can see why it is like this, but it is a problem, because they do link to filesystem locations.
I have ended up writing some incomplete and not ideal path substitution methods as a work around. Anyone know any proper way of dealing with this? Is quite hard to search for anything to do with libraries, so I have not managed to find anything.