Project

General

Profile

« Previous | Next » 

Revision cbd36af4

Added by Katja Luther about 7 years ago

catch NPE for DwCA Export

View differences:

eu.etaxonomy.taxeditor.store/src/main/java/eu/etaxonomy/taxeditor/io/wizard/DarwinCoreArchiveExportWizard.java
1 1
/**
2 2
 * Copyright (C) 2007 EDIT
3
 * European Distributed Institute of Taxonomy 
3
 * European Distributed Institute of Taxonomy
4 4
 * http://www.e-taxonomy.eu
5
 * 
5
 *
6 6
 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 7
 * See LICENSE.TXT at the top of this package for the full license terms.
8 8
 */
......
11 11

  
12 12
import java.io.File;
13 13

  
14
import org.eclipse.core.runtime.jobs.Job;
14 15
import org.eclipse.jface.viewers.IStructuredSelection;
15 16
import org.eclipse.ui.IWorkbench;
17
import org.eclipse.ui.progress.IProgressConstants;
16 18

  
17 19
import eu.etaxonomy.cdm.io.dwca.out.DwcaTaxExportConfigurator;
18 20
import eu.etaxonomy.taxeditor.store.CdmStore;
......
30 32

  
31 33
	/*
32 34
	 * (non-Javadoc)
33
	 * 
35
	 *
34 36
	 * @see org.eclipse.ui.IWorkbenchWizard#init(org.eclipse.ui.IWorkbench,
35 37
	 * org.eclipse.jface.viewers.IStructuredSelection)
36 38
	 */
......
38 40
	public void init(IWorkbench workbench, IStructuredSelection selection) {
39 41
		configurator = DwcaTaxExportConfigurator.NewInstance(null, null, null);
40 42
	}
41
 
43

  
42 44
	/*
43 45
	 * (non-Javadoc)
44
	 * 
46
	 *
45 47
	 * @see
46 48
	 * eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#getConfigurator()
47 49
	 */
......
52 54

  
53 55
	/*
54 56
	 * (non-Javadoc)
55
	 * 
57
	 *
56 58
	 * @see org.eclipse.jface.wizard.Wizard#performFinish()
57 59
	 */
58 60
	@Override
......
62 64

  
63 65
		configurator.setDestination(new File(urlString));
64 66

  
65
		CdmStore.getExportManager().run(configurator);
67
		Job exportJob = CdmStore.getExportManager().createIOServiceJob(configurator, configurator.getDestination());
68
		exportJob.setProperty(IProgressConstants.KEEP_PROPERTY, true);
69
		exportJob.setUser(true);
70
        // schedule job
71
		exportJob.schedule();
66 72

  
67 73
		return true;
68 74
	}
69 75

  
70 76
	/*
71 77
	 * (non-Javadoc)
72
	 * 
78
	 *
73 79
	 * @see eu.etaxonomy.taxeditor.io.wizard.AbstractExportWizard#addPages()
74 80
	 */
75 81
	@Override

Also available in: Unified diff