Project

General

Profile

Download (4.1 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.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
	@SuppressWarnings("deprecation")
32
	public static URI normalExplicit(){
33
		try {
34
//			URL url = new File(("C:\\localCopy\\eclipse\\cdmlib\\trunk\\app-import\\src\\main\\resources\\excel\\NormalExplicit.xls")).toURL();
35
			
36
			// FIXME what is this????
37
			URL url = new File("D:\\NormalExplicit.xls").toURI().toURL();
38

    
39
			
40
//			URL url = new TcsSources().getClass().getResource("excel/NormalExplicit.xls");
41
			boolean exists = new File(url.getFile()).exists();
42
			if (! exists) throw new RuntimeException("File not found: " + url);
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 arecaceae_short(){
89
		//		Monocots rdf
90
		URL url = new SDDSources().getClass().getResource("/arecaceae_short.rdf");
91
		String sourceUrl = url.toString();
92
		return sourceUrl;
93
	}
94

    
95
	public static String tcsXmlTest_local(){
96
		//		tcsXmlTest.xml
97
		URL url = new TcsSources().getClass().getResource("/tcs/tcsXmlTest.xml");
98
		String sourceUrl = url.toString();
99
		return sourceUrl;
100
		
101
	}	
102

    
103
	public static String tcsXml_cichorium(){
104
		//		tcsXmlTest.xml
105
		URL url = new TcsSources().getClass().getResource("/tcs/Cichorium_tcs.xml");
106
		String sourceUrl = url.toString();
107
		return sourceUrl;	
108
	}
109
	
110
	public static String tcsXml_localPath(){
111
		File file = new File("C:\\localCopy\\Data\\tdwg\\Cichorium_tcs.xml");
112
		String sourceUrl;
113
		try{
114
			sourceUrl = file.toURI().toURL().toString();
115
		} catch (MalformedURLException e) {
116
			e.printStackTrace();
117
			throw new RuntimeException(e);
118
		}
119
		return sourceUrl;
120
		
121
	}	
122
	
123
	public static String tcsXmlTest_local2(){
124
		//		tcsXmlTest.xml
125
		URL url = new TcsSources().getClass().getResource("/TcsXmlImportConfiguratorTest-input.xml");
126
		String sourceUrl = url.toString();
127
		return sourceUrl;	
128
	}
129
	
130
	public static String tcsRdf_globis(){
131
		//		globis.rdf.xml
132
		//String sourceUrl = "file:C:/Dokumente und Einstellungen/a.kohlbecker.BGBM/Desktop/globis.rdf.xml";
133
		String sourceUrl = "/globis_valid.rdf.xml";
134
		URL resourceUrl = new TcsSources().getClass().getResource(sourceUrl);
135
		logger.debug("TcsRdfSource " +  resourceUrl.toString());
136
		return resourceUrl.toString();
137
		
138
	}	
139
	
140

    
141
	
142
}
(2-2/3)