Index: src/org/openide/filesystems/FileUtil.java =================================================================== RCS file: /cvs/openide/src/org/openide/filesystems/FileUtil.java,v retrieving revision 1.110 diff -r1.110 FileUtil.java 27,35c27 < import java.util.Arrays; < import java.util.Enumeration; < import java.util.HashMap; < import java.util.HashSet; < import java.util.Iterator; < import java.util.Map; < import java.util.Set; < import java.util.StringTokenizer; < import java.util.WeakHashMap; --- > import java.util.*; 970a963,1005 > } > } else if (Utilities.getOperatingSystem() == Utilities.OS_MAC) { > try { > file = new File(file.toURI().normalize()).getAbsoluteFile(); > File cannonicalFile = file.getCanonicalFile(); > if (cannonicalFile.getAbsolutePath().equalsIgnoreCase(file.getAbsolutePath())) { > file = cannonicalFile; > } > else { > String fileName = file.getAbsolutePath(); > final String pattern = File.separator + ".." + File.separator; //NOI18N > int index = fileName.lastIndexOf (pattern); > if (index>-1) { > fileName = fileName.substring (index+pattern.length()); //Remove starting {/../}* > } > else { > fileName = fileName.substring(1); //Remove starting / > } > File f = File.listRoots()[0]; > StringTokenizer tk = new StringTokenizer (fileName, File.separator); > List nameComponents = new ArrayList (); > while (tk.hasMoreTokens()) { > String name = tk.nextToken(); > File newFile = new File (f, name); > f = newFile.getCanonicalFile(); > if (f.getAbsolutePath().equalsIgnoreCase(newFile.getAbsolutePath())) { > nameComponents.add (f.getName()); > } > else { > nameComponents.add (newFile.getName()); > } > } > f = File.listRoots()[0]; > for (Iterator it = nameComponents.iterator(); it.hasNext();) { > String nameComponent = (String) it.next (); > f = new File (f, nameComponent); > } > file = f; > } > } catch (IOException ioe) { > ErrorManager.getDefault().log(ErrorManager.ERROR, "getCanonicalFile() on file "+file+" failed. "+ ioe.toString()); // NOI18N > // OK, so at least try to absolutize the path > file = file.getAbsoluteFile();