Skip to content

Commit ac5bb38

Browse files
committed
Rename Downloads.download BiConsumer argument
Rename from progressConsumer to progressSubscriber, for two reasons: 1. Consistency with Builder's subscribeOutput, subscribeError, and subscribeProgress functions, which accept "subscriber" objects. 2. There is an existing interface ProgressConsumer used by the Builder#subscribeProgress reporting, but the BiConsumer argument of download is *not* an object implementing this interface.
1 parent 1eb2f6d commit ac5bb38

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/apposed/appose/util/Downloads.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static File download(String name, String urlPath)
7878
return download(name, urlPath, null);
7979
}
8080

81-
public static File download(String name, String urlPath, @Nullable BiConsumer<Long, Long> progressConsumer)
81+
public static File download(String name, String urlPath, @Nullable BiConsumer<Long, Long> progressSubscriber)
8282
throws IOException, InterruptedException, URISyntaxException
8383
{
8484
// Resolve redirects and get final URL
@@ -134,8 +134,8 @@ public static File download(String name, String urlPath, @Nullable BiConsumer<Lo
134134
dwnldThread.start();
135135
while (dwnldThread.isAlive()) {
136136
Thread.sleep(20); // 50 FPS update rate
137-
if (progressConsumer != null)
138-
progressConsumer.accept(tempFile.length(), size);
137+
if (progressSubscriber != null)
138+
progressSubscriber.accept(tempFile.length(), size);
139139
}
140140
if (ioe[0] != null) throw ioe[0];
141141
if (ie[0] != null) throw ie[0];

0 commit comments

Comments
 (0)