Ticket #8175: 8175.patch

File 8175.patch, 6.4 KB (added by Don-vip, 11 years ago)
  • build.xml

     
    2929    <property name="plugin.dist.dir" value="../../dist"/>
    3030    <property name="plugin.build.dir" value="build"/>
    3131    <property name="plugin.jar" value="${plugin.dist.dir}/${ant.project.name}.jar"/>
    32     <property name="ant.build.javac.target" value="1.5"/>
     32    <property name="ant.build.javac.target" value="1.6"/>
    3333    <property name="commit.message" value="Changed constructor for Plugin"/>
    34     <property name="plugin.main.version" value="5553"/>
     34    <property name="plugin.main.version" value="5587"/>
    3535    <target name="init">
    3636        <mkdir dir="${plugin.build.dir}"/>
    3737    </target>
  • src/cadastre_fr/CadastreGrabber.java

     
    1616import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    1717import org.openstreetmap.josm.io.OsmTransferException;
    1818import org.openstreetmap.josm.io.ProgressInputStream;
     19import org.openstreetmap.josm.tools.Utils;
    1920
    2021public class CadastreGrabber {
    2122
     
    8384    }
    8485
    8586    private BufferedImage grab(URL url) throws IOException, OsmTransferException {
    86         wmsInterface.urlConn = (HttpURLConnection)url.openConnection();
     87        wmsInterface.urlConn = Utils.openHttpConnection(url, false);
    8788        wmsInterface.urlConn.setRequestMethod("GET");
    8889        wmsInterface.setCookie();
    8990        InputStream is = new ProgressInputStream(wmsInterface.urlConn, NullProgressMonitor.INSTANCE);
  • src/cadastre_fr/CadastreInterface.java

     
    2323import org.openstreetmap.josm.data.coor.EastNorth;
    2424import org.openstreetmap.josm.gui.layer.Layer;
    2525import org.openstreetmap.josm.tools.GBC;
     26import org.openstreetmap.josm.tools.Utils;
    2627
    2728public class CadastreInterface {
    2829    public boolean downloadCanceled = false;
     
    109110        try {
    110111            searchFormURL = new URL(baseURL + "/scpc/accueil.do");
    111112            while (cookied == false && retries > 0) {
    112                 urlConn = (HttpURLConnection)searchFormURL.openConnection();
     113                urlConn = Utils.openHttpConnection(searchFormURL, false);
    113114                urlConn.setRequestMethod("GET");
    114115                urlConn.connect();
    115116                if (urlConn.getResponseCode() == HttpURLConnection.HTTP_OK) {
     
    213214            String lines = null;
    214215            String ln = null;
    215216            URL interfaceURL = new URL(baseURL + "/scpc/"+interfaceRef);
    216             urlConn = (HttpURLConnection)interfaceURL.openConnection();
     217            urlConn = Utils.openHttpConnection(interfaceURL, false);
    217218            urlConn.setRequestMethod("GET");
    218219            setCookie();
    219220            urlConn.connect();
     
    274275            content += "&nbResultatParPage=10";
    275276            content += "&x=0&y=0";
    276277            searchFormURL = new URL(baseURL + "/scpc/rechercherPlan.do");
    277             urlConn = (HttpURLConnection)searchFormURL.openConnection();
     278            urlConn = Utils.openHttpConnection(searchFormURL, false);
    278279            urlConn.setRequestMethod("POST");
    279280            urlConn.setDoOutput(true);
    280281            urlConn.setDoInput(true);
     
    363364        HttpURLConnection urlConn2 = null;
    364365        try {
    365366            URL getAllImagesURL = new URL(baseURL + "/scpc/listerFeuillesParcommune.do?keepVolatileSession=&offset=2000");
    366             urlConn2 = (HttpURLConnection)getAllImagesURL.openConnection();
     367            urlConn2 = Utils.openHttpConnection(getAllImagesURL, false);
    367368            setCookie(urlConn2);
    368369            urlConn2.connect();
    369370            System.out.println("GET "+getAllImagesURL);
     
    470471        String content = baseURL + "/scpc/" + interfaceRef;
    471472        content += "&dontSaveLastForward&keepVolatileSession=";
    472473        searchFormURL = new URL(content);
    473         urlConn = (HttpURLConnection)searchFormURL.openConnection();
     474        urlConn = Utils.openHttpConnection(searchFormURL, false);
    474475        urlConn.setRequestMethod("GET");
    475476        setCookie();
    476477        urlConn.connect();
  • src/cadastre_fr/DownloadSVGBuilding.java

     
    3232import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    3333import org.openstreetmap.josm.io.OsmTransferException;
    3434import org.openstreetmap.josm.io.ProgressInputStream;
     35import org.openstreetmap.josm.tools.Utils;
    3536
    3637public class DownloadSVGBuilding extends PleaseWaitRunnable {
    3738
     
    234235    }
    235236
    236237    private String grabSVG(URL url) throws IOException, OsmTransferException {
    237         wmsInterface.urlConn = (HttpURLConnection)url.openConnection();
     238        wmsInterface.urlConn = Utils.openHttpConnection(url, false);
    238239        wmsInterface.urlConn.setRequestMethod("GET");
    239240        wmsInterface.setCookie();
    240241        InputStream is = new ProgressInputStream(wmsInterface.urlConn, NullProgressMonitor.INSTANCE);
  • src/cadastre_fr/DownloadSVGTask.java

     
    3232import org.openstreetmap.josm.gui.progress.NullProgressMonitor;
    3333import org.openstreetmap.josm.io.OsmTransferException;
    3434import org.openstreetmap.josm.io.ProgressInputStream;
     35import org.openstreetmap.josm.tools.Utils;
    3536/**
    3637 * Grab the SVG administrative boundaries of the active commune layer (cadastre),
    3738 * isolate the SVG path of the concerned commune (other municipalities are also
     
    188189    }
    189190
    190191    private String grabSVG(URL url) throws IOException, OsmTransferException {
    191         wmsInterface.urlConn = (HttpURLConnection)url.openConnection();
     192        wmsInterface.urlConn = Utils.openHttpConnection(url, false);
    192193        wmsInterface.urlConn.setRequestMethod("GET");
    193194        wmsInterface.setCookie();
    194195        InputStream is = new ProgressInputStream(wmsInterface.urlConn, NullProgressMonitor.INSTANCE);