[ 
https://issues.apache.org/jira/browse/VFS-339?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14000921#comment-14000921
 ] 

Bernd Eckenfels commented on VFS-339:
-------------------------------------

BTW: the Folders behave quite strange, some have toString() with a display name 
and some have getName() with the display information. Java itself does not deal 
with the ::{} ones very well, it qualified them with the current directory if 
you use getAbsoluteName().

{code}
File[] files = 
(File[])sun.awt.shell.ShellFolder.get("fileChooserComboBoxFolders");
for(File f : files)
  System.out.println("" + f.getClass().getName() + " name=" + f.getName() + " 
tostring="+ f.toString());

sun.awt.shell.Win32ShellFolder2 name=Recent 
tostring=C:\Users\NAME\AppData\Roaming\Microsoft\Windows\Recent
sun.awt.shell.Win32ShellFolder2 name=Desktop tostring=C:\Users\NAME\Desktop
sun.awt.shell.Win32ShellFolder2 name=::{20D04FE0-3AEA-1069-A2D8-08002B30309D} 
tostring=Computer
sun.awt.shell.Win32ShellFolder2 name= tostring=C:\
...
sun.awt.shell.Win32ShellFolder2 name= tostring=U:\
sun.awt.shell.Win32ShellFolder2 name=server 
tostring=C:\Users\eckenfel\AppData\Roaming\Microsoft\Windows\Network 
Shortcuts\server
sun.awt.shell.Win32ShellFolder2 name=::{F02C1A0D-BE21-4350-88B0-7367FC96EF3C} 
tostring=Netzwerk
sun.awt.shell.Win32ShellFolder2 name=::{031E4825-7B94-4DC3-B131-E946B44C8DD5} 
tostring=Bibliotheken
sun.awt.shell.Win32ShellFolder2 name=::{B4FB3F98-C1EA-428D-A78A-D1F5659CBA93} 
tostring=Heimnetzgruppe
{code}

BTW: I am not sure how this is related to VFS-338, my samples do not have //// 
prefix?

> Unable to resolve special windows folders
> -----------------------------------------
>
>                 Key: VFS-339
>                 URL: https://issues.apache.org/jira/browse/VFS-339
>             Project: Commons VFS
>          Issue Type: Bug
>    Affects Versions: 2.0
>         Environment: Windows
>            Reporter: Daniel R
>            Priority: Critical
>
> VFS unable to support special windows folders (Network, recent, computer, 
> libraries, etc).
> File[] cbFolders = 
> (File[])sun.awt.shell.ShellFolder.get("fileChooserComboBoxFolders");
> and then converting them to FileObjects like so:
>               for(File f: cbFolders){
>                       fileObjArray.add(mgr.resolveFile(f.getPath()));
>               }
> The path of these files are like "::{20D04FE0-3AEA-1069-A2D8-08002B30309D}"
> So I tried to debug it and fixed this bug: 
> https://issues.apache.org/jira/browse/VFS-338
> and then removed:
>  if (startPos < 2)
>         {
>             throw new 
> FileSystemException("vfs.provider.local/not-absolute-file-name.error", uri);
>         }
>  return "//" + extractUNCPrefix(uri, name);
> But now complains about the file doesn't exist. I'll keep trying...



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to