Changeset 34344 in osm for applications/editors
- Timestamp:
- 2018-06-23T12:55:33+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/tracer2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/tracer2/build.xml
r33908 r34344 5 5 <property name="commit.message" value="see #josm11090"/> 6 6 <!-- enter the *lowest* JOSM version this plugin is currently compatible with --> 7 <property name="plugin.main.version" value="13 007"/>7 <property name="plugin.main.version" value="13910"/> 8 8 9 9 <!-- Configure these properties (replace "..." accordingly). -
applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/server/Request.java
r32788 r34344 4 4 import static org.openstreetmap.josm.tools.I18n.tr; 5 5 6 import java.io.BufferedReader; 7 import java.io.InputStreamReader; 8 import java.net.ConnectException; 6 import java.io.IOException; 9 7 import java.net.URL; 10 8 … … 12 10 13 11 import org.openstreetmap.josm.Main; 12 import org.openstreetmap.josm.tools.HttpClient; 14 13 15 14 public class Request extends Thread { … … 27 26 protected String callServer(String strUrl) { 28 27 try { 29 URL oUrl = new URL(URL + strUrl); 30 BufferedReader oReader = new BufferedReader(new InputStreamReader(oUrl.openStream())); 31 StringBuilder oBuilder = new StringBuilder(); 32 String strLine; 33 while ((strLine = oReader.readLine()) != null) { 34 oBuilder.append(strLine); 35 } 36 return oBuilder.toString(); 37 } catch (ConnectException e) { 28 return HttpClient.create(new URL(URL + strUrl)).connect().fetchContent(); 29 } catch (IOException e) { 38 30 JOptionPane.showMessageDialog(Main.parent, 39 31 tr("Tracer2Server isn''t running. Please start the Server.\nIf you don''t have the server, please download it from\n{0}.",
Note:
See TracChangeset
for help on using the changeset viewer.