206432
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/AppFileLocProvider.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/AppFileLocProvider.java
index 22d3adc..8cc0c71 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/AppFileLocProvider.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/AppFileLocProvider.java
@@ -10,7 +10,7 @@
*******************************************************************************/
package org.eclipse.swt.browser;
-import org.eclipse.swt.internal.C;
+import org.eclipse.swt.internal.*;
import org.eclipse.swt.internal.mozilla.*;
class AppFileLocProvider {
@@ -117,6 +117,19 @@
void setProfilePath (String path) {
profilePath = path;
+ if (!Compatibility.fileExists (path, "")) { //$NON-NLS-1$
+ int /*long*/[] result = new int /*long*/[1];
+ nsEmbedString pathString = new nsEmbedString (path);
+ int rc = XPCOM.NS_NewLocalFile (pathString.getAddress (), true, result);
+ if (rc != XPCOM.NS_OK) Mozilla.error (rc);
+ if (result[0] == 0) Mozilla.error (XPCOM.NS_ERROR_NULL_POINTER);
+ pathString.dispose ();
+
+ nsILocalFile file = new nsILocalFile (result [0]);
+ rc = file.Create (nsILocalFile.DIRECTORY_TYPE, 0700);
+ if (rc != XPCOM.NS_OK) Mozilla.error (rc);
+ file.Release ();
+ }
}
/* nsIDirectoryServiceProvider2 */
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/Compatibility.java b/bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/Compatibility.java
index d0f693c..027e953 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/Compatibility.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common_j2me/org/eclipse/swt/internal/Compatibility.java
@@ -285,6 +285,17 @@
}
/**
+ * Answers whether the indicated file exists or not.
+ *
+ * @param parent the file's parent directory
+ * @param child the file's name
+ * @return true if the file exists
+ */
+public static boolean fileExists(String parent, String child) {
+ return false;
+}
+
+/**
* Execute progArray[0] in a separate platform process if the
* underlying platform support this.
* <p>
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/Compatibility.java b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/Compatibility.java
index 455292d..680ffb0 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/Compatibility.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/common_j2se/org/eclipse/swt/internal/Compatibility.java
@@ -98,6 +98,17 @@
}
/**
+ * Answers whether the indicated file exists or not.
+ *
+ * @param parent the file's parent directory
+ * @param child the file's name
+ * @return true if the file exists
+ */
+public static boolean fileExists(String parent, String child) {
+ return new File (parent, child).exists();
+}
+
+/**
* Answers the most positive (i.e. closest to positive infinity)
* integer value which is less than the number obtained by dividing
* the first argument p by the second argument q.