Andrew Overholt 3503180
### Eclipse Workspace Patch 1.0
Andrew Overholt 3503180
#P org.eclipse.swt
Andrew Overholt 3503180
Index: Eclipse_SWT_Mozilla/common/org/eclipse/swt/browser/AppFileLocProvider.java
Andrew Overholt 3503180
===================================================================
Andrew Overholt 3503180
RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse_SWT_Mozilla/common/org/eclipse/swt/browser/AppFileLocProvider.java,v
Andrew Overholt 3503180
retrieving revision 1.10
Andrew Overholt 3503180
diff -u -r1.10 AppFileLocProvider.java
Andrew Overholt 3503180
--- Eclipse_SWT_Mozilla/common/org/eclipse/swt/browser/AppFileLocProvider.java	23 Aug 2007 17:10:46 -0000	1.10
Andrew Overholt 3503180
+++ Eclipse_SWT_Mozilla/common/org/eclipse/swt/browser/AppFileLocProvider.java	14 May 2008 18:08:48 -0000
Andrew Overholt 3503180
@@ -12,7 +12,7 @@
Andrew Overholt 3503180
 
Andrew Overholt 3503180
 import java.util.Vector;
Andrew Overholt 3503180
 
Andrew Overholt 3503180
-import org.eclipse.swt.internal.C;
Andrew Overholt 3503180
+import org.eclipse.swt.internal.*;
Andrew Overholt 3503180
 import org.eclipse.swt.internal.mozilla.*;
Andrew Overholt 3503180
 
Andrew Overholt 3503180
 class AppFileLocProvider {
Andrew Overholt 3503180
@@ -119,6 +119,19 @@
Andrew Overholt 3503180
 
Andrew Overholt 3503180
 void setProfilePath (String path) {
Andrew Overholt 3503180
 	profilePath = path;
Andrew Overholt 3503180
+	if (!Compatibility.fileExists (path, "")) { //$NON-NLS-1$
Andrew Overholt 3503180
+		int /*long*/[] result = new int /*long*/[1];
Andrew Overholt 3503180
+		nsEmbedString pathString = new nsEmbedString (path);
Andrew Overholt 3503180
+		int rc = XPCOM.NS_NewLocalFile (pathString.getAddress (), true, result);
Andrew Overholt 3503180
+		if (rc != XPCOM.NS_OK) Mozilla.error (rc);
Andrew Overholt 3503180
+		if (result[0] == 0) Mozilla.error (XPCOM.NS_ERROR_NULL_POINTER);
Andrew Overholt 3503180
+		pathString.dispose ();
Andrew Overholt 3503180
+
Andrew Overholt 3503180
+		nsILocalFile file = new nsILocalFile (result [0]);
Andrew Overholt 3503180
+		rc = file.Create (nsILocalFile.DIRECTORY_TYPE, 0700);
Andrew Overholt 3503180
+		if (rc != XPCOM.NS_OK) Mozilla.error (rc);
Andrew Overholt 3503180
+		file.Release ();
Andrew Overholt 3503180
+	}
Andrew Overholt 3503180
 }
Andrew Overholt 3503180
 
Andrew Overholt 3503180
 /* nsIDirectoryServiceProvider2 */
Andrew Overholt 3503180
Index: Eclipse_SWT/common_j2se/org/eclipse/swt/internal/Compatibility.java
Andrew Overholt 3503180
===================================================================
Andrew Overholt 3503180
RCS file: /cvsroot/eclipse/org.eclipse.swt/Eclipse_SWT/common_j2se/org/eclipse/swt/internal/Compatibility.java,v
Andrew Overholt 3503180
retrieving revision 1.28
Andrew Overholt 3503180
diff -u -r1.28 Compatibility.java
Andrew Overholt 3503180
--- Eclipse_SWT/common_j2se/org/eclipse/swt/internal/Compatibility.java	10 Oct 2007 18:36:05 -0000	1.28
Andrew Overholt 3503180
+++ Eclipse_SWT/common_j2se/org/eclipse/swt/internal/Compatibility.java	14 May 2008 18:08:48 -0000
Andrew Overholt 3503180
@@ -99,6 +99,17 @@
Andrew Overholt 3503180
 }
Andrew Overholt 3503180
 
Andrew Overholt 3503180
 /**
Andrew Overholt 3503180
+ * Answers whether the indicated file exists or not.
Andrew Overholt 3503180
+ * 
Andrew Overholt 3503180
+ * @param parent the file's parent directory
Andrew Overholt 3503180
+ * @param child the file's name
Andrew Overholt 3503180
+ * @return true if the file exists
Andrew Overholt 3503180
+ */
Andrew Overholt 3503180
+public static boolean fileExists(String parent, String child) {
Andrew Overholt 3503180
+	return new File (parent, child).exists();
Andrew Overholt 3503180
+}
Andrew Overholt 3503180
+
Andrew Overholt 3503180
+/**
Andrew Overholt 3503180
  * Answers the most positive (i.e. closest to positive infinity)
Andrew Overholt 3503180
  * integer value which is less than the number obtained by dividing
Andrew Overholt 3503180
  * the first argument p by the second argument q.