- error handling for report file
authorPatric Plitzner <p.plitzner@bgbm.org>
Tue, 27 Jan 2015 10:56:52 +0000 (10:56 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Tue, 27 Jan 2015 10:56:52 +0000 (10:56 +0000)
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportWizard.java
eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ClassificationChooserWizardPage.java

index 36ec38a4e446ec9559bb9d3468b1bc1e1fb76aa3..19eb4604d84c79aa0919c8bc74c5664ab84ae361 100644 (file)
@@ -21,7 +21,9 @@ import org.eclipse.ui.IWorkbench;
 
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
 
 import eu.etaxonomy.cdm.database.DbSchemaValidation;
 import eu.etaxonomy.cdm.io.specimen.abcd206.in.Abcd206ImportConfigurator;
+import eu.etaxonomy.taxeditor.model.MessagingUtils;
 import eu.etaxonomy.taxeditor.store.CdmStore;
 import eu.etaxonomy.taxeditor.store.CdmStore;
+import eu.etaxonomy.taxeditor.store.internal.TaxeditorStorePlugin;
 
 /**
  * <p>AbcdImportWizard class.</p>
 
 /**
  * <p>AbcdImportWizard class.</p>
@@ -57,6 +59,7 @@ public class AbcdImportWizard extends AbstractImportWizard<Abcd206ImportConfigur
                try {
             configurator.setSource(new FileInputStream(new File(source)));
         } catch (FileNotFoundException e) {
                try {
             configurator.setSource(new FileInputStream(new File(source)));
         } catch (FileNotFoundException e) {
+            MessagingUtils.errorDialog("File not found.", this, "Import file was not found.", TaxeditorStorePlugin.PLUGIN_ID, e, false);
             logger.error("File not found!", e);
             return false;
         }
             logger.error("File not found!", e);
             return false;
         }
index b2fb046dd8e965e1b64f26f1c7831a12e71fd2fe..da353112490a5cfc8acd5051a5ac75e3cb8437b7 100644 (file)
@@ -165,6 +165,10 @@ public class ClassificationChooserWizardPage extends WizardPage implements Liste
     }
 
     public URI getReportUri(){
     }
 
     public URI getReportUri(){
-        return new File(textFileReport.getText()).toURI();
+        String text = textFileReport.getText();
+        if(text==null || text.isEmpty()){
+            return null;
+        }
+        return new File(text).toURI();
     }
 }
     }
 }