Skip to content

Commit c8b6f2e

Browse files
committed
Progress javadoc tweaks
1 parent 6cbe7e4 commit c8b6f2e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/main/java/org/jsoup/Connection.java

+4-3
Original file line numberDiff line numberDiff line change
@@ -477,11 +477,12 @@ default Connection auth(@Nullable RequestAuthenticator authenticator) {
477477
Connection response(Response response);
478478

479479
/**
480-
Set the response progress handler, which will be called as the response body is downloaded. As documents are parsed
481-
as they are downloaded, this is also a good proxy for the parse progress.
482-
<p>The Response is supplied as the progress context and may be read from to obtain headers etc.</p>
480+
Set the response progress handler, which will be called periodically as the response body is downloaded. Since
481+
documents are parsed as they are downloaded, this is also a good proxy for the parse progress.
482+
<p>The Response object is supplied as the progress context, and may be read from to obtain headers etc.</p>
483483
@param handler the progress handler
484484
@return this Connection, for chaining
485+
@since 1.18.1
485486
*/
486487
default Connection onResponseProgress(Progress<Response> handler) {
487488
throw new UnsupportedOperationException();

src/main/java/org/jsoup/Progress.java

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package org.jsoup;
22

33
@FunctionalInterface
4+
45
public interface Progress<ProgressContext> {
56
/**
67
Called to report progress. Note that this will be executed by the same thread that is doing the work, so either
@@ -10,6 +11,7 @@ public interface Progress<ProgressContext> {
1011
@param percent the percentage of completion, 0.0..100.0. If the expected total is unknown, % will remain at zero
1112
until complete.
1213
@param context the object that progress was made on.
14+
@since 1.18.1
1315
*/
1416
void onProgress(int processed, int total, float percent, ProgressContext context);
1517
}

0 commit comments

Comments
 (0)