Changeset 9171 in josm for trunk/src/org/openstreetmap/josm/gui/dialogs/properties
- Timestamp:
- 2015-12-26T23:42:00+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/dialogs/properties/PropertiesDialog.java
r9149 r9171 16 16 import java.beans.PropertyChangeEvent; 17 17 import java.beans.PropertyChangeListener; 18 import java.net.HttpURLConnection;19 18 import java.net.URI; 20 19 import java.net.URISyntaxException; … … 101 100 import org.openstreetmap.josm.tools.AlphanumComparator; 102 101 import org.openstreetmap.josm.tools.GBC; 102 import org.openstreetmap.josm.tools.HttpClient; 103 103 import org.openstreetmap.josm.tools.ImageProvider; 104 104 import org.openstreetmap.josm.tools.InputMapUtils; … … 1171 1171 try { 1172 1172 // find a page that actually exists in the wiki 1173 Http URLConnectionconn;1173 HttpClient.Response conn; 1174 1174 for (URI u : uris) { 1175 conn = Utils.openHttpConnection(u.toURL()); 1176 conn.setConnectTimeout(Main.pref.getInteger("socket.timeout.connect", 15)*1000); 1175 conn = HttpClient.create(u.toURL(), "HEAD").connect(); 1177 1176 1178 1177 if (conn.getResponseCode() != 200) { 1179 Main.info("{0} does not exist", u);1180 1178 conn.disconnect(); 1181 1179 } else { 1182 intosize = conn.getContentLength();1180 long osize = conn.getContentLength(); 1183 1181 if (osize > -1) { 1184 1182 conn.disconnect(); 1185 1183 1186 conn = Utils.openHttpConnection(new URI(u.toString()1184 final URI newURI = new URI(u.toString() 1187 1185 .replace("=", "%3D") /* do not URLencode whole string! */ 1188 1186 .replaceFirst("/wiki/", "/w/index.php?redirect=no&title=") 1189 ).toURL());1190 conn .setConnectTimeout(Main.pref.getInteger("socket.timeout.connect", 15)*1000);1187 ); 1188 conn = HttpClient.create(newURI.toURL(), "HEAD").connect(); 1191 1189 } 1192 1190 … … 1199 1197 conn.disconnect(); 1200 1198 } else { 1201 Main.info("browsing to {0}", u);1202 1199 conn.disconnect(); 1203 1200
Note:
See TracChangeset
for help on using the changeset viewer.