< prev index next >

src/java.desktop/windows/classes/sun/awt/shell/Win32ShellFolderManager2.java

Print this page

        

@@ -29,10 +29,11 @@
 import java.awt.image.BufferedImage;
 
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.IOException;
+import java.io.UncheckedIOException;
 import java.security.AccessController;
 import java.security.PrivilegedAction;
 import java.util.*;
 import java.util.List;
 import java.util.concurrent.*;

@@ -372,10 +373,27 @@
                 if (i >= 0) {
                     return Win32ShellFolder2.getShell32Icon(i, key.startsWith("shell32LargeIcon "));
                 }
             } catch (NumberFormatException ex) {
             }
+        } else if (key.startsWith("{") && key.endsWith("}")) {
+            try {
+                long pidl = getDesktop().parseDisplayName("shell:::" + key);
+                return Win32ShellFolder2.createShellFolder(getDesktop(), pidl);
+            } catch (IOException ex) {
+                throw new InternalError(ex);
+            }catch(InterruptedException ex) {
+            }
+        } else if(key.startsWith("parseDisplayName ")) {
+            String name = key.substring("parseDisplayName ".length());
+            try {
+                long pidl = getDesktop().parseDisplayName(name);
+                return Win32ShellFolder2.createShellFolder(getDesktop(), pidl);
+            } catch (IOException ex) {
+                throw new UncheckedIOException(ex);
+            } catch(InterruptedException ex) {
+            }
         }
         return null;
     }
 
     private File checkFile(File file) {
< prev index next >