Bug 3223 - New project wizard does not handle a case when there is a project in the location
--- a/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WRTProjectDetailsWizardPage.java Tue Jul 13 14:25:10 2010 -0700
+++ b/org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WRTProjectDetailsWizardPage.java Tue Jul 13 15:27:46 2010 -0700
@@ -18,6 +18,7 @@
*/
package org.symbian.tools.wrttools.wizards;
+import java.io.File;
import java.net.URI;
import org.eclipse.core.databinding.DataBindingContext;
@@ -249,6 +250,14 @@
setErrorMessage(validLocationMessage);
return false;
}
+ File file = new File(locationArea.getProjectLocationURI());
+ if (file.isFile()) {
+ setErrorMessage(String.format("%s is an existing file", file));
+ return false;
+ } else if (file.isDirectory() && file.listFiles().length > 0) {
+ setErrorMessage(String.format("%s is a non-empty folder", file));
+ return false;
+ }
setErrorMessage(null);
setMessage(null);