Changeset 9168 in josm for trunk/src/org/openstreetmap/josm/plugins
- Timestamp:
- 2015-12-26T23:41:52+01:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java
r9059 r9168 10 10 import java.io.InputStream; 11 11 import java.io.OutputStream; 12 import java.net.HttpURLConnection;13 12 import java.net.MalformedURLException; 14 13 import java.net.URL; … … 22 21 import org.openstreetmap.josm.gui.progress.NullProgressMonitor; 23 22 import org.openstreetmap.josm.gui.progress.ProgressMonitor; 24 import org.openstreetmap.josm.io.CachedFile;25 23 import org.openstreetmap.josm.tools.CheckParameterUtil; 24 import org.openstreetmap.josm.tools.HttpClient; 26 25 import org.xml.sax.SAXException; 27 26 … … 45 44 private final Collection<PluginInformation> downloaded = new LinkedList<>(); 46 45 private boolean canceled; 47 private Http URLConnectiondownloadConnection;46 private HttpClient.Response downloadConnection; 48 47 49 48 /** … … 124 123 URL url = new URL(pi.downloadlink); 125 124 synchronized (this) { 126 downloadConnection = CachedFile.connectFollowingRedirect(url, PLUGIN_MIME_TYPES, null); 125 downloadConnection = HttpClient.create(url) 126 .setAccept(PLUGIN_MIME_TYPES) 127 .connect(); 127 128 } 128 129 try ( 129 InputStream in = downloadConnection.get InputStream();130 InputStream in = downloadConnection.getContent(); 130 131 OutputStream out = new FileOutputStream(file) 131 132 ) {
Note:
See TracChangeset
for help on using the changeset viewer.