minor
[cdmlib-apps.git] / app-import / src / main / java / eu / etaxonomy / cdm / app / tcs / TcsSources.java
1 /**
2 * Copyright (C) 2007 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
5 *
6 * The contents of this file are subject to the Mozilla Public License Version 1.1
7 * See LICENSE.TXT at the top of this package for the full license terms.
8 */
9
10 package eu.etaxonomy.cdm.app.tcs;
11
12 import java.io.File;
13 import java.net.MalformedURLException;
14 import java.net.URI;
15 import java.net.URISyntaxException;
16 import java.net.URL;
17
18 import org.apache.log4j.Logger;
19
20 import eu.etaxonomy.cdm.app.sdd.SDDSources;
21
22 /**
23 * @author a.mueller
24 * @created 20.06.2008
25 * @version 1.0
26 */
27 public class TcsSources {
28 private static final Logger logger = Logger.getLogger(TcsSources.class);
29
30
31 public static URI normalExplicit(){
32 try {
33 // URL url = new File(("C:\\localCopy\\eclipse\\cdmlib\\trunk\\app-import\\src\\main\\resources\\excel\\NormalExplicit.xls")).toURL();
34
35 // FIXME what is this????
36 URL url = new File("D:\\NormalExplicit.xls").toURI().toURL();
37
38
39 // URL url = new TcsSources().getClass().getResource("excel/NormalExplicit.xls");
40 boolean exists = new File(url.getFile()).exists();
41 if (! exists) throw new RuntimeException("File not found: " + url);
42 URI uri = url.toURI();
43 return uri;
44 } catch (MalformedURLException e1) {
45 // TODO Auto-generated catch block
46 e1.printStackTrace();
47 throw new RuntimeException(e1);
48 } catch (URISyntaxException e) {
49 e.printStackTrace();
50 throw new RuntimeException(e);
51 }
52
53 }
54
55 public static String arecaceae(){
56 // Monocots rdf
57 String sourceUrl = "http://dev.e-taxonomy.eu/trac/attachment/wiki/SampleDataConversion/Monocotyledonae/arecaceae.rdf?format=raw";
58 logger.debug("TcsSource " + sourceUrl);
59 return sourceUrl;
60
61 }
62
63 public static String taxonX_local(){
64 // Monocots rdf
65 //String sourceUrl = "file:C:/localCopy/eclipse/cdmlib/app-import/src/main/resources/palm_tn_29336.xml";
66 URL url = new SDDSources().getClass().getResource("/taxonX/palm_tn_29336.xml");
67 String sourceUrl = url.toString();
68 return sourceUrl;
69 }
70
71 public static File taxonX_localDir(){
72 // Monocots rdf
73 File sourceDir = new File("target/classes/taxonX/"); //palm_tc_14495.xml
74 return sourceDir;
75 }
76
77 public static String arecaceae_local(){
78 // Monocots rdf
79 //String sourceUrl = "file:C:/localCopy/eclipse/cdmlib/app-import/src/main/resources/arecaceae.rdf";
80 URL url = new SDDSources().getClass().getResource("/arecaceae.rdf");
81 String sourceUrl = url.toString();
82 return sourceUrl;
83
84 }
85
86
87 public static String tcsXml_cichorium(){
88 // tcsXmlTest.xml
89 URL url = new TcsSources().getClass().getResource("/tcs/Cichorium_tcs.xml");
90 String sourceUrl = url.toString();
91 return sourceUrl;
92 }
93
94 public static String tcsXml_nyctaginaceae(){
95 try {
96 File file = new File("\\\\PESIIMPORT3\\caryo\\nyctaginaceae\\ipni-Nyctaginaceae-Caryophyllaceae.xml");
97 return file.toURI().toURL().toString();
98 } catch (MalformedURLException e) {
99 throw new RuntimeException(e);
100 }
101
102 }
103
104
105
106 public static String tcsXml_localPath(){
107 File file = new File("C:\\localCopy\\Data\\tdwg\\Cichorium_tcs.xml");
108 String sourceUrl;
109 try{
110 sourceUrl = file.toURI().toURL().toString();
111 } catch (MalformedURLException e) {
112 e.printStackTrace();
113 throw new RuntimeException(e);
114 }
115 return sourceUrl;
116
117 }
118
119 public static String tcsXmlTest_local2(){
120 // tcsXmlTest.xml
121 URL url = new TcsSources().getClass().getResource("/TcsXmlImportConfiguratorTest-input.xml");
122 String sourceUrl = url.toString();
123 return sourceUrl;
124 }
125
126 public static String tcsRdf_globis(){
127 // globis.rdf.xml
128 //String sourceUrl = "file:C:/Dokumente und Einstellungen/a.kohlbecker.BGBM/Desktop/globis.rdf.xml";
129 String sourceUrl = "/globis_valid.rdf.xml";
130 URL resourceUrl = new TcsSources().getClass().getResource(sourceUrl);
131 logger.debug("TcsRdfSource " + resourceUrl.toString());
132 return resourceUrl.toString();
133
134 }
135
136
137
138 }