Changeset 9171 in josm for trunk/src/org/openstreetmap/josm/io
- Timestamp:
- 2015-12-26T23:42:00+01:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/io/imagery/WMSImagery.java
r9108 r9171 3 3 4 4 import java.awt.HeadlessException; 5 import java.io.BufferedReader;6 5 import java.io.IOException; 7 import java.io.InputStream;8 6 import java.io.StringReader; 9 7 import java.net.MalformedURLException; 10 8 import java.net.URL; 11 import java.net.URLConnection;12 9 import java.util.ArrayList; 13 10 import java.util.Collection; … … 27 24 import org.openstreetmap.josm.data.imagery.ImageryInfo; 28 25 import org.openstreetmap.josm.data.projection.Projections; 29 import org.openstreetmap.josm. io.UTFInputStreamReader;26 import org.openstreetmap.josm.tools.HttpClient; 30 27 import org.openstreetmap.josm.tools.Predicate; 31 28 import org.openstreetmap.josm.tools.Utils; … … 137 134 138 135 Main.info("GET " + getCapabilitiesUrl); 139 URLConnection openConnection = Utils.openHttpConnection(getCapabilitiesUrl, false, true); 140 StringBuilder ba = new StringBuilder(); 141 142 try ( 143 InputStream inputStream = openConnection.getInputStream(); 144 BufferedReader br = new BufferedReader(UTFInputStreamReader.create(inputStream)) 145 ) { 146 String line; 147 while ((line = br.readLine()) != null) { 148 ba.append(line); 149 ba.append('\n'); 150 } 151 } 152 String incomingData = ba.toString(); 136 final String incomingData = HttpClient.create(getCapabilitiesUrl).connect().fetchContent(); 153 137 Main.debug("Server response to Capabilities request:"); 154 138 Main.debug(incomingData);
Note:
See TracChangeset
for help on using the changeset viewer.