Revision 26790e9b
Added by Andreas Müller over 3 years ago
app-import/src/main/java/eu/etaxonomy/cdm/app/tcs/TcsSources.java | ||
---|---|---|
10 | 10 |
|
11 | 11 |
import java.io.File; |
12 | 12 |
import java.net.MalformedURLException; |
13 |
import java.net.URI; |
|
14 | 13 |
import java.net.URISyntaxException; |
15 | 14 |
import java.net.URL; |
16 | 15 |
|
17 | 16 |
import org.apache.log4j.Logger; |
18 | 17 |
|
19 | 18 |
import eu.etaxonomy.cdm.app.sdd.SDDSources; |
19 |
import eu.etaxonomy.cdm.common.URI; |
|
20 | 20 |
|
21 | 21 |
/** |
22 | 22 |
* @author a.mueller |
... | ... | |
36 | 36 |
|
37 | 37 |
// URL url = new TcsSources().getClass().getResource("excel/NormalExplicit.xls"); |
38 | 38 |
boolean exists = new File(url.getFile()).exists(); |
39 |
if (! exists) throw new RuntimeException("File not found: " + url); |
|
40 |
URI uri = url.toURI(); |
|
39 |
if (! exists) { |
|
40 |
throw new RuntimeException("File not found: " + url); |
|
41 |
} |
|
42 |
URI uri = URI.fromUrl(url); |
|
41 | 43 |
return uri; |
42 | 44 |
} catch (MalformedURLException e1) { |
43 | 45 |
// TODO Auto-generated catch block |
Also available in: Unified diff
ref #9114 adapt URI to wrapper in cdmlib-app