1 package uk.ac.ebi.intenz.tools.importer;
2
3 import java.io.IOException;
4 import java.util.Properties;
5
6
7
8
9
10
11
12
13
14
15 public abstract class Importer {
16
17 protected Properties importerProps;
18
19 protected Importer() throws IOException{
20 importerProps = new Properties();
21 importerProps.load(this.getClass().getClassLoader()
22 .getResourceAsStream("Importer.properties"));
23 }
24
25
26
27
28
29
30 public final void doImport () throws Exception {
31 try {
32 setup();
33 importData();
34 loadData();
35 } finally {
36 destroy();
37 }
38 }
39
40
41
42
43 protected abstract void setup () throws Exception;
44
45
46
47
48
49 protected abstract void importData () throws Exception;
50
51
52
53
54 protected abstract void loadData () throws Exception;
55
56
57
58
59 protected abstract void destroy ();
60
61 }