Changeset 34344 in osm for applications/editors


Ignore:
Timestamp:
2018-06-23T12:55:33+02:00 (7 years ago)
Author:
donvip
Message:

update to JOSM 13910

Location:
applications/editors/josm/plugins/tracer2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/tracer2/build.xml

    r33908 r34344  
    55    <property name="commit.message" value="see #josm11090"/>
    66    <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
    7     <property name="plugin.main.version" value="13007"/>
     7    <property name="plugin.main.version" value="13910"/>
    88
    99    <!-- Configure these properties (replace "..." accordingly).
  • applications/editors/josm/plugins/tracer2/src/org/openstreetmap/josm/plugins/tracer2/server/Request.java

    r32788 r34344  
    44import static org.openstreetmap.josm.tools.I18n.tr;
    55
    6 import java.io.BufferedReader;
    7 import java.io.InputStreamReader;
    8 import java.net.ConnectException;
     6import java.io.IOException;
    97import java.net.URL;
    108
     
    1210
    1311import org.openstreetmap.josm.Main;
     12import org.openstreetmap.josm.tools.HttpClient;
    1413
    1514public class Request extends Thread {
     
    2726    protected String callServer(String strUrl) {
    2827        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) {
    3830            JOptionPane.showMessageDialog(Main.parent,
    3931                    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.