Changeset 10302 in josm for trunk/src/org/openstreetmap/josm/tools
- Timestamp:
- 2016-05-30T09:24:08+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/HttpClient.java
r10300 r10302 52 52 private HttpURLConnection connection; // to allow disconnecting before `response` is set 53 53 private Response response; 54 private boolean finishOnCloseOutput = true; 54 55 55 56 static { … … 111 112 connection.setDoOutput(true); 112 113 try (OutputStream out = new BufferedOutputStream( 113 new ProgressOutputStream(connection.getOutputStream(), requestBody.length, progressMonitor ))) {114 new ProgressOutputStream(connection.getOutputStream(), requestBody.length, progressMonitor, finishOnCloseOutput))) { 114 115 out.write(requestBody); 115 116 } … … 598 599 } 599 600 601 /** 602 * Sets whether the progress monitor task will be finished when the output stream is closed. This is {@code true} by default. 603 * @param finishOnCloseOutput whether the progress monitor task will be finished when the output stream is closed 604 * @return {@code this} 605 * @since 10302 606 */ 607 public HttpClient setFinishOnCloseOutput(boolean finishOnCloseOutput) { 608 this.finishOnCloseOutput = finishOnCloseOutput; 609 return this; 610 } 611 600 612 private static boolean isRedirect(final int statusCode) { 601 613 switch (statusCode) {
Note: See TracChangeset
for help on using the changeset viewer.