Project

General

Profile

Revision 4bccf32d

ID4bccf32d64c369d04be985a0aa22e761d2897093
Parent cd704234
Child e29e2ebd

Added by Katja Luther about 5 years ago

minor changes in excel import wizard

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/ExcelNormalExplicitTaxaImportWizard.java
11 11
package eu.etaxonomy.taxeditor.io.wizard;
12 12

  
13 13
import java.io.File;
14
import java.io.FileInputStream;
15
import java.io.FileNotFoundException;
14 16
import java.net.URI;
17
import org.apache.log4j.Logger;
15 18

  
16 19
import org.eclipse.core.runtime.jobs.Job;
17 20
import org.eclipse.jface.viewers.IStructuredSelection;
......
22 25
import eu.etaxonomy.cdm.io.common.IImportConfigurator.SOURCE_TYPE;
23 26
import eu.etaxonomy.cdm.io.excel.taxa.NormalExplicitImportConfigurator;
24 27
import eu.etaxonomy.cdm.model.taxon.TaxonNode;
28

  
25 29
import eu.etaxonomy.taxeditor.store.CdmStore;
26 30

  
27 31

  
......
37 41
	private NormalExplicitImportConfigurator configurator;
38 42

  
39 43
	private ImportFromFileDataSourceWizardPage dataSourcePage;
44
	private static final Logger logger = Logger.getLogger(ExcelNormalExplicitTaxaImportWizard.class);
40 45

  
41 46
	/* (non-Javadoc)
42 47
	 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractImportWizard#getConfigurator()
......
56 61
		URI source = dataSourcePage.getUri();
57 62
		configurator.setSource(source);
58 63
		configurator.setDbSchemaValidation(DbSchemaValidation.CREATE);
64
		File file = new File(source);
65
		FileInputStream fis = null;
59 66

  
60
	    Job job = CdmStore.getImportManager().createIOServiceJob(configurator, new File(source), SOURCE_TYPE.URI);
67
		try {
68
			fis = new FileInputStream(file);
69
		} catch (FileNotFoundException e) {
70
			logger.error("Error while reading file" + source.toString());
71
		}
72
			
73
	    Job job = CdmStore.getImportManager().createIOServiceJob(configurator,file , SOURCE_TYPE.INPUTSTREAM);
61 74
	    CdmStore.getImportManager().run(job);
62 75
		
63 76
		return true;

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)