- adapted AbcdImportWizard to model (using input stream as input)
authorPatric Plitzner <p.plitzner@bgbm.org>
Mon, 23 Sep 2013 15:54:29 +0000 (15:54 +0000)
committerPatric Plitzner <p.plitzner@bgbm.org>
Mon, 23 Sep 2013 15:54:29 +0000 (15:54 +0000)
  - added exception logging

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/AbcdImportWizard.java

index acab4046c1c0c607f17ce36e2c891655d0e6f155..c2975144f35b7012631f9300aacc0a7890a0ac6b 100644 (file)
 
 package eu.etaxonomy.taxeditor.io.wizard;
 
 
 package eu.etaxonomy.taxeditor.io.wizard;
 
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
 import java.net.URI;
 
 import java.net.URI;
 
+import org.apache.log4j.Logger;
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IWorkbench;
 
 import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.ui.IWorkbench;
 
@@ -28,6 +32,8 @@ import eu.etaxonomy.taxeditor.store.CdmStore;
  */
 public class AbcdImportWizard extends AbstractImportWizard<Abcd206ImportConfigurator> {
 
  */
 public class AbcdImportWizard extends AbstractImportWizard<Abcd206ImportConfigurator> {
 
+    private static final Logger logger = Logger.getLogger(AbcdImportWizard.class);
+
        private Abcd206ImportConfigurator configurator;
        private ImportFromFileDataSourceWizardPage dataSourcePage;
 
        private Abcd206ImportConfigurator configurator;
        private ImportFromFileDataSourceWizardPage dataSourcePage;
 
@@ -47,8 +53,12 @@ public class AbcdImportWizard extends AbstractImportWizard<Abcd206ImportConfigur
        @Override
        public boolean performFinish() {
                URI source = dataSourcePage.getUri();
        @Override
        public boolean performFinish() {
                URI source = dataSourcePage.getUri();
-//             InputStream inputStream = new FileInputStream(new File(source));
-               configurator.setSource(source);
+               try {
+            configurator.setSource(new FileInputStream(new File(source)));
+        } catch (FileNotFoundException e) {
+            logger.error("File not found!", e);
+            return false;
+        }
                configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
 
                CdmStore.getImportManager().run(configurator);
                configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
 
                CdmStore.getImportManager().run(configurator);