Changeset 12711 in josm for trunk/src/org/openstreetmap/josm/tools/HttpClient.java
- Timestamp:
- 2017-09-01T23:55:45+02:00 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/HttpClient.java
r12620 r12711 53 53 private boolean useCache; 54 54 private String reasonForRequest; 55 private String outputMessage = tr("Uploading data ..."); 55 56 private HttpURLConnection connection; // to allow disconnecting before `response` is set 56 57 private Response response; … … 115 116 connection.setDoOutput(true); 116 117 try (OutputStream out = new BufferedOutputStream( 117 new ProgressOutputStream(connection.getOutputStream(), requestBody.length, progressMonitor, finishOnCloseOutput))) { 118 new ProgressOutputStream(connection.getOutputStream(), requestBody.length, 119 progressMonitor, outputMessage, finishOnCloseOutput))) { 118 120 out.write(requestBody); 119 121 } … … 622 624 623 625 /** 626 * Sets the output message to be displayed in progress monitor for {@code PUT}, {@code POST} and {@code DELETE} methods. 627 * Defaults to "Uploading data ..." (translated). Has no effect for {@code GET} or any other method. 628 * @param outputMessage message to be displayed in progress monitor 629 * @return {@code this} 630 * @since 12711 631 */ 632 public HttpClient setOutputMessage(String outputMessage) { 633 this.outputMessage = outputMessage; 634 return this; 635 } 636 637 /** 624 638 * Sets whether the progress monitor task will be finished when the output stream is closed. This is {@code true} by default. 625 639 * @param finishOnCloseOutput whether the progress monitor task will be finished when the output stream is closed
Note:
See TracChangeset
for help on using the changeset viewer.