Project

General

Profile

« Previous | Next » 

Revision de8249cf

Added by Andreas Müller over 3 years ago

ref #9114 add URI Wrapper and replace all java.net.URI occurrences by the wrapper in cdmlib

View differences:

cdmlib-ext/src/main/java/eu/etaxonomy/cdm/ext/scratchpads/ScratchpadsService.java
14 14
import java.io.IOException;
15 15
import java.io.InputStream;
16 16
import java.io.InputStreamReader;
17
import java.net.URI;
18 17
import java.net.URISyntaxException;
19 18
import java.net.URL;
20 19
import java.util.Iterator;
......
28 27
import com.fasterxml.jackson.databind.JsonNode;
29 28
import com.fasterxml.jackson.databind.ObjectMapper;
30 29

  
30
import eu.etaxonomy.cdm.common.URI;
31 31
import eu.etaxonomy.cdm.common.UriUtils;
32 32

  
33 33

  
......
52 52

  
53 53
		try {
54 54
			URL url = new URL(SCRATCHPADS_JSON_ENDPOINT);
55
			boolean isAvailable = UriUtils.isServiceAvailable(url.toURI());
55
			boolean isAvailable = UriUtils.isServiceAvailable(URI.fromUrl(url));
56 56

  
57 57
			if (isAvailable) {
58
				inputStream = UriUtils.getInputStream(url.toURI());
58
				inputStream = UriUtils.getInputStream(URI.fromUrl(url));
59 59
			}
60 60

  
61 61
			BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, "iso-8859-1"), 8);
......
85 85
					if (fieldWebsite.startsWith("http")) {
86 86

  
87 87
						url = new URL(fieldWebsite + "/dwca.zip");
88
						URI uri = url.toURI();
88
						URI uri = URI.fromUrl(url);
89 89
						isAvailable = UriUtils.isServiceAvailable(uri);
90 90
						logger.debug("Is " + fieldWebsite + " available :" + isAvailable);
91 91

  
......
117 117
								logger.debug("There is a dwca " + websiteName);
118 118

  
119 119
								try {
120
									inputStream = UriUtils.getInputStream(url.toURI());
121

  
120
									inputStream = UriUtils.getInputStream(URI.fromUrl(url));
122 121
									num++;
123 122
									if (inputStream != null) {
124 123
										copyDwcaZip(inputStream, websiteName);

Also available in: Unified diff