Revision b920f5c2
Added by Andreas Müller over 3 years ago
app-import/src/main/java/eu/etaxonomy/cdm/app/tcs/TcsSources.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 |
*/ |
9 |
|
|
10 | 9 |
package eu.etaxonomy.cdm.app.tcs; |
11 | 10 |
|
12 | 11 |
import java.io.File; |
... | ... | |
22 | 21 |
/** |
23 | 22 |
* @author a.mueller |
24 | 23 |
* @since 20.06.2008 |
25 |
* @version 1.0 |
|
26 | 24 |
*/ |
27 | 25 |
public class TcsSources { |
28 |
private static final Logger logger = Logger.getLogger(TcsSources.class); |
|
29 |
|
|
30 |
|
|
26 |
|
|
27 |
private static final Logger logger = Logger.getLogger(TcsSources.class); |
|
28 |
|
|
31 | 29 |
public static URI normalExplicit(){ |
32 | 30 |
try { |
33 | 31 |
// URL url = new File(("C:\\localCopy\\eclipse\\cdmlib\\trunk\\app-import\\src\\main\\resources\\excel\\NormalExplicit.xls")).toURL(); |
34 |
|
|
32 |
|
|
35 | 33 |
// FIXME what is this???? |
36 | 34 |
URL url = new File("D:\\NormalExplicit.xls").toURI().toURL(); |
37 | 35 |
|
38 |
|
|
36 |
|
|
39 | 37 |
// URL url = new TcsSources().getClass().getResource("excel/NormalExplicit.xls"); |
40 | 38 |
boolean exists = new File(url.getFile()).exists(); |
41 | 39 |
if (! exists) throw new RuntimeException("File not found: " + url); |
... | ... | |
49 | 47 |
e.printStackTrace(); |
50 | 48 |
throw new RuntimeException(e); |
51 | 49 |
} |
52 |
|
|
53 | 50 |
} |
54 |
|
|
51 |
|
|
55 | 52 |
public static String arecaceae(){ |
56 | 53 |
// Monocots rdf |
57 | 54 |
String sourceUrl = "http://dev.e-taxonomy.eu/trac/attachment/wiki/SampleDataConversion/Monocotyledonae/arecaceae.rdf?format=raw"; |
58 | 55 |
logger.debug("TcsSource " + sourceUrl); |
59 | 56 |
return sourceUrl; |
60 |
|
|
61 | 57 |
} |
62 |
|
|
58 |
|
|
63 | 59 |
public static String taxonX_local(){ |
64 | 60 |
// Monocots rdf |
65 | 61 |
//String sourceUrl = "file:C:/localCopy/eclipse/cdmlib/app-import/src/main/resources/palm_tn_29336.xml"; |
... | ... | |
73 | 69 |
File sourceDir = new File("target/classes/taxonX/"); //palm_tc_14495.xml |
74 | 70 |
return sourceDir; |
75 | 71 |
} |
76 |
|
|
72 |
|
|
77 | 73 |
public static String arecaceae_local(){ |
78 | 74 |
// Monocots rdf |
79 | 75 |
//String sourceUrl = "file:C:/localCopy/eclipse/cdmlib/app-import/src/main/resources/arecaceae.rdf"; |
80 | 76 |
URL url = new SDDSources().getClass().getResource("/arecaceae.rdf"); |
81 | 77 |
String sourceUrl = url.toString(); |
82 | 78 |
return sourceUrl; |
83 |
|
|
84 | 79 |
} |
85 | 80 |
|
86 |
|
|
87 | 81 |
public static String tcsXml_cichorium(){ |
88 | 82 |
// tcsXmlTest.xml |
89 | 83 |
URL url = new TcsSources().getClass().getResource("/tcs/Cichorium_tcs.xml"); |
90 | 84 |
String sourceUrl = url.toString(); |
91 |
return sourceUrl;
|
|
85 |
return sourceUrl; |
|
92 | 86 |
} |
93 | 87 |
|
94 | 88 |
public static String tcsXml_nyctaginaceae(){ |
... | ... | |
98 | 92 |
} catch (MalformedURLException e) { |
99 | 93 |
throw new RuntimeException(e); |
100 | 94 |
} |
101 |
|
|
102 | 95 |
} |
103 | 96 |
|
104 |
|
|
105 |
|
|
106 | 97 |
public static String tcsXml_localPath(){ |
107 | 98 |
File file = new File("C:\\localCopy\\Data\\tdwg\\Cichorium_tcs.xml"); |
108 | 99 |
String sourceUrl; |
... | ... | |
113 | 104 |
throw new RuntimeException(e); |
114 | 105 |
} |
115 | 106 |
return sourceUrl; |
116 |
|
|
117 |
} |
|
118 |
|
|
107 |
} |
|
108 |
|
|
119 | 109 |
public static String tcsXmlTest_local2(){ |
120 | 110 |
// tcsXmlTest.xml |
121 | 111 |
URL url = new TcsSources().getClass().getResource("/TcsXmlImportConfiguratorTest-input.xml"); |
122 | 112 |
String sourceUrl = url.toString(); |
123 |
return sourceUrl;
|
|
113 |
return sourceUrl; |
|
124 | 114 |
} |
125 |
|
|
115 |
|
|
126 | 116 |
public static String tcsRdf_globis(){ |
127 | 117 |
// globis.rdf.xml |
128 | 118 |
//String sourceUrl = "file:C:/Dokumente und Einstellungen/a.kohlbecker.BGBM/Desktop/globis.rdf.xml"; |
... | ... | |
130 | 120 |
URL resourceUrl = new TcsSources().getClass().getResource(sourceUrl); |
131 | 121 |
logger.debug("TcsRdfSource " + resourceUrl.toString()); |
132 | 122 |
return resourceUrl.toString(); |
133 |
|
|
134 |
} |
|
135 |
|
|
123 |
} |
|
124 |
|
|
136 | 125 |
public static String tcsRdf_test(){ |
137 | 126 |
// globis.rdf.xml |
138 | 127 |
//String sourceUrl = "file:C:/Dokumente und Einstellungen/a.kohlbecker.BGBM/Desktop/globis.rdf.xml"; |
... | ... | |
140 | 129 |
URL resourceUrl = new TcsSources().getClass().getResource(sourceUrl); |
141 | 130 |
logger.debug("TcsRdfSource " + resourceUrl.toString()); |
142 | 131 |
return resourceUrl.toString(); |
143 |
|
|
144 |
} |
|
145 |
|
|
146 |
|
|
147 |
} |
|
132 |
} |
|
133 |
} |
Also available in: Unified diff
cleanup