Project

General

Profile

Download (3.96 KB) Statistics
| Branch: | Revision:
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.caryophyllales;
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 k.luther
24
 * @since May 2014
25
 */
26
public class TcsSources {
27
	private static final Logger logger = Logger.getLogger(TcsSources.class);
28

    
29

    
30
	public static URI normalExplicit(){
31
		try {
32
//			URL url = new File(("C:\\localCopy\\eclipse\\cdmlib\\trunk\\app-import\\src\\main\\resources\\excel\\NormalExplicit.xls")).toURL();
33

    
34
			// FIXME what is this????
35
			URL url = new File("D:\\NormalExplicit.xls").toURI().toURL();
36

    
37

    
38
//			URL url = new TcsSources().getClass().getResource("excel/NormalExplicit.xls");
39
			boolean exists = new File(url.getFile()).exists();
40
			if (! exists) {
41
                throw new RuntimeException("File not found: " + url);
42
            }
43
			URI uri = url.toURI();
44
			return uri;
45
		} catch (MalformedURLException e1) {
46
			// TODO Auto-generated catch block
47
			e1.printStackTrace();
48
			throw new RuntimeException(e1);
49
		} catch (URISyntaxException e) {
50
			e.printStackTrace();
51
			throw new RuntimeException(e);
52
		}
53

    
54
	}
55

    
56
	public static String arecaceae(){
57
		//	Monocots rdf
58
		String sourceUrl = "http://dev.e-taxonomy.eu/trac/attachment/wiki/SampleDataConversion/Monocotyledonae/arecaceae.rdf?format=raw";
59
		logger.debug("TcsSource " +  sourceUrl);
60
		return sourceUrl;
61

    
62
	}
63

    
64
	public static String taxonX_local(){
65
		//		Monocots rdf
66
		//String sourceUrl = "file:C:/localCopy/eclipse/cdmlib/app-import/src/main/resources/palm_tn_29336.xml";
67
		URL url = new SDDSources().getClass().getResource("/taxonX/palm_tn_29336.xml");
68
		String sourceUrl = url.toString();
69
		return sourceUrl;
70
	}
71

    
72
	public static File taxonX_localDir(){
73
		//		Monocots rdf
74
		File sourceDir = new File("target/classes/taxonX/"); //palm_tc_14495.xml
75
		return sourceDir;
76
	}
77

    
78
	public static String arecaceae_local(){
79
		//		Monocots rdf
80
		//String sourceUrl = "file:C:/localCopy/eclipse/cdmlib/app-import/src/main/resources/arecaceae.rdf";
81
		URL url = new SDDSources().getClass().getResource("/arecaceae.rdf");
82
		String sourceUrl = url.toString();
83
		return sourceUrl;
84

    
85
	}
86

    
87

    
88
	public static String tcsXml_cichorium(){
89
		//		tcsXmlTest.xml
90
		URL url = new TcsSources().getClass().getResource("/tcs/Cichorium_tcs.xml");
91
		String sourceUrl = url.toString();
92
		return sourceUrl;
93
	}
94

    
95
	public static String tcsXml_nyctaginaceae(){
96
		try {
97
			File file = new File("C:\\Users\\k.luther\\Desktop\\ipni-Nyctaginaceae-Caryophyllaceae.xml\\ipni-Caryophyllaceae.xml");
98
			return file.toURI().toURL().toString();
99
		} catch (MalformedURLException e) {
100
			throw new RuntimeException(e);
101
		}
102

    
103
	}
104

    
105

    
106

    
107
	public static String tcsXml_localPath(){
108
		File file = new File("C:\\localCopy\\Data\\tdwg\\Cichorium_tcs.xml");
109
		String sourceUrl;
110
		try{
111
			sourceUrl = file.toURI().toURL().toString();
112
		} catch (MalformedURLException e) {
113
			e.printStackTrace();
114
			throw new RuntimeException(e);
115
		}
116
		return sourceUrl;
117

    
118
	}
119

    
120
	public static String tcsXmlTest_local2(){
121
		//		tcsXmlTest.xml
122
		URL url = new TcsSources().getClass().getResource("/TcsXmlImportConfiguratorTest-input.xml");
123
		String sourceUrl = url.toString();
124
		return sourceUrl;
125
	}
126

    
127
	public static String tcsRdf_globis(){
128
		//		globis.rdf.xml
129
		//String sourceUrl = "file:C:/Dokumente und Einstellungen/a.kohlbecker.BGBM/Desktop/globis.rdf.xml";
130
		String sourceUrl = "/globis_valid.rdf.xml";
131
		URL resourceUrl = new TcsSources().getClass().getResource(sourceUrl);
132
		logger.debug("TcsRdfSource " +  resourceUrl.toString());
133
		return resourceUrl.toString();
134

    
135
	}
136

    
137

    
138

    
139
}
(13-13/15)