Bug 3223 - New project wizard does not handle a case when there is a project in the location
authorEugene Ostroukhov <eugeneo@symbian.org>
Tue, 13 Jul 2010 15:27:46 -0700
changeset 443 c5a1d477afa1
parent 442 980aaebb8022
child 444 6eb42310f8b5
Bug 3223 - New project wizard does not handle a case when there is a project in the location
org.symbian.tools.wrttools/src/org/symbian/tools/wrttools/wizards/WRTProjectDetailsWizardPage.java
--- 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);