Project

General

Profile

Download (3.92 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
package eu.etaxonomy.cdm.app.caryophyllales;
10

    
11
import java.io.File;
12
import java.net.MalformedURLException;
13
import java.net.URISyntaxException;
14
import java.net.URL;
15

    
16
import org.apache.log4j.Logger;
17

    
18
import eu.etaxonomy.cdm.app.sdd.SDDSources;
19
import eu.etaxonomy.cdm.common.URI;
20

    
21
/**
22
 * @author k.luther
23
 * @since May 2014
24
 */
25
public class TcsSources {
26

    
27
	private static final Logger logger = Logger.getLogger(TcsSources.class);
28

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

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

    
36

    
37
//			URL url = new TcsSources().getClass().getResource("excel/NormalExplicit.xls");
38
			boolean exists = new File(url.getFile()).exists();
39
			if (! exists) {
40
                throw new RuntimeException("File not found: " + url);
41
            }
42
			URI uri = URI.fromUrl(url);
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
	public static String arecaceae(){
55
		//	Monocots rdf
56
		String sourceUrl = "https://dev.e-taxonomy.eu/redmine/attachments/download/865/arecaceae.rdf";
57
		logger.debug("TcsSource " +  sourceUrl);
58
		return sourceUrl;
59

    
60
	}
61

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

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

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

    
83
	}
84

    
85

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

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

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

    
114
	public static String tcsXmlTest_local2(){
115
		//		tcsXmlTest.xml
116
		URL url = new TcsSources().getClass().getResource("/TcsXmlImportConfiguratorTest-input.xml");
117
		String sourceUrl = url.toString();
118
		return sourceUrl;
119
	}
120

    
121
	public static String tcsRdf_globis(){
122
		//		globis.rdf.xml
123
		//String sourceUrl = "file:C:/Dokumente und Einstellungen/a.kohlbecker.BGBM/Desktop/globis.rdf.xml";
124
		String sourceUrl = "/globis_valid.rdf.xml";
125
		URL resourceUrl = new TcsSources().getClass().getResource(sourceUrl);
126
		logger.debug("TcsRdfSource " +  resourceUrl.toString());
127
		return resourceUrl.toString();
128
	}
129
}
(16-16/18)