Changeset 9309 in josm for trunk/src/org/openstreetmap/josm/plugins
- Timestamp:
- 2016-01-04T20:51:45+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/plugins
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/plugins/PluginDownloadTask.java
r9280 r9309 44 44 private final Collection<PluginInformation> downloaded = new LinkedList<>(); 45 45 private boolean canceled; 46 private HttpClient .ResponsedownloadConnection;46 private HttpClient downloadConnection; 47 47 48 48 /** … … 124 124 synchronized (this) { 125 125 downloadConnection = HttpClient.create(url) 126 .setAccept(PLUGIN_MIME_TYPES) 127 128 } 129 try (InputStream in = downloadConnection.get Content()) {126 .setAccept(PLUGIN_MIME_TYPES); 127 downloadConnection.connect(); 128 } 129 try (InputStream in = downloadConnection.getResponse().getContent()) { 130 130 Files.copy(in, file.toPath(), StandardCopyOption.REPLACE_EXISTING); 131 131 } -
trunk/src/org/openstreetmap/josm/plugins/ReadRemotePluginInformationTask.java
r9296 r9309 51 51 private Collection<String> sites; 52 52 private boolean canceled; 53 private HttpClient .Responseconnection;53 private HttpClient connection; 54 54 private List<PluginInformation> availablePlugins; 55 55 private boolean displayErrMsg; … … 157 157 158 158 URL url = new URL(site); 159 connection = HttpClient.create(url).useCache(false).connect(); 160 content = connection.fetchContent(); 161 if (connection.getResponseCode() != 200) { 159 connection = HttpClient.create(url).useCache(false); 160 final HttpClient.Response response = connection.connect(); 161 content = response.fetchContent(); 162 if (response.getResponseCode() != 200) { 162 163 throw new IOException(tr("Unsuccessful HTTP request")); 163 164 }
Note:
See TracChangeset
for help on using the changeset viewer.