Ignore:
Timestamp:
2015-12-26T23:42:00+01:00 (6 years ago)
Author:
simon04
Message:

see #12231 - Use HttpClient instead of some Utils.openHttpConnection usages

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/CachedAttributionBingAerialTileSource.java

    r8836 r9171  
    66import java.net.URL;
    77import java.util.List;
    8 import java.util.Scanner;
    98import java.util.concurrent.Callable;
    109
     
    1413import org.openstreetmap.josm.gui.util.GuiHelper;
    1514import org.openstreetmap.josm.io.CacheCustomContent;
    16 import org.openstreetmap.josm.io.UTFInputStreamReader;
    17 import org.openstreetmap.josm.tools.Utils;
     15import org.openstreetmap.josm.tools.HttpClient;
    1816import org.xml.sax.InputSource;
    1917
     
    5553        protected byte[] updateData() throws IOException {
    5654            URL u = getAttributionUrl();
    57             try (Scanner scanner = new Scanner(UTFInputStreamReader.create(Utils.openURL(u)))) {
    58                 String r = scanner.useDelimiter("\\A").next();
    59                 Main.info("Successfully loaded Bing attribution data.");
    60                 return r.getBytes("UTF-8");
    61             }
     55            final String r = HttpClient.create(u).connect().fetchContent();
     56            Main.info("Successfully loaded Bing attribution data.");
     57            return r.getBytes("UTF-8");
    6258        }
    6359    }
Note: See TracChangeset for help on using the changeset viewer.