Skip to content

Commit 35b5201

Browse files
committed
Remove Callback suffix from UploadProgress interface
1 parent e83358e commit 35b5201

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

lib/src/main/java/com/github/kevinsawicki/http/HttpRequest.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ public static void setConnectionFactory(final ConnectionFactory connectionFactor
381381
/**
382382
* Callback interface for reporting upload progress for a request.
383383
*/
384-
public interface UploadProgressCallback {
384+
public interface UploadProgress {
385385

386386
/**
387387
* Callback invoked as data is uploaded by the request.
@@ -392,7 +392,7 @@ public interface UploadProgressCallback {
392392
*/
393393
void onUpload(int uploaded, int total);
394394

395-
UploadProgressCallback DEFAULT = new UploadProgressCallback() {
395+
UploadProgress DEFAULT = new UploadProgress() {
396396
public void onUpload(int uploaded, int total) {
397397
}
398398
};
@@ -1418,7 +1418,7 @@ public String run() {
14181418

14191419
private int httpProxyPort;
14201420

1421-
private UploadProgressCallback progress = UploadProgressCallback.DEFAULT;
1421+
private UploadProgress progress = UploadProgress.DEFAULT;
14221422

14231423
/**
14241424
* Create HTTP connection wrapper
@@ -2603,14 +2603,14 @@ public HttpRequest run() throws IOException {
26032603
}
26042604

26052605
/**
2606-
* Set the UploadProgressCallback for this request
2606+
* Set the UploadProgress for this request
26072607
*
26082608
* @param callback
26092609
* @return this request
26102610
*/
2611-
public HttpRequest progress(final UploadProgressCallback callback) {
2611+
public HttpRequest progress(final UploadProgress callback) {
26122612
if (callback == null)
2613-
progress = UploadProgressCallback.DEFAULT;
2613+
progress = UploadProgress.DEFAULT;
26142614
else
26152615
progress = callback;
26162616
return this;

lib/src/test/java/com/github/kevinsawicki/http/HttpRequestTest.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
import static org.junit.Assert.fail;
4444
import com.github.kevinsawicki.http.HttpRequest.HttpRequestException;
4545
import com.github.kevinsawicki.http.HttpRequest.ConnectionFactory;
46-
import com.github.kevinsawicki.http.HttpRequest.UploadProgressCallback;
46+
import com.github.kevinsawicki.http.HttpRequest.UploadProgress;
4747

4848
import java.io.BufferedReader;
4949
import java.io.ByteArrayInputStream;
@@ -3466,7 +3466,7 @@ public void handle(Request request, HttpServletResponse response) {
34663466
* @throws Exception
34673467
*/
34683468
@Test
3469-
public void uploadProgressCallbackSend() throws Exception {
3469+
public void uploadProgressSend() throws Exception {
34703470
final AtomicReference<String> body = new AtomicReference<String>();
34713471
handler = new RequestHandler() {
34723472

@@ -3480,7 +3480,7 @@ public void handle(Request request, HttpServletResponse response) {
34803480
new FileWriter(file).append("hello").close();
34813481

34823482
final AtomicInteger tx = new AtomicInteger(0);
3483-
UploadProgressCallback progress = new UploadProgressCallback() {
3483+
UploadProgress progress = new UploadProgress() {
34843484
public void onUpload(int transferred, int total) {
34853485
assertEquals(file.length(), total);
34863486
assertEquals(tx.incrementAndGet(), transferred);
@@ -3496,7 +3496,7 @@ public void onUpload(int transferred, int total) {
34963496
* @throws Exception
34973497
*/
34983498
@Test
3499-
public void uploadProgressCallbackSendInputStream() throws Exception {
3499+
public void uploadProgressSendInputStream() throws Exception {
35003500
final AtomicReference<String> body = new AtomicReference<String>();
35013501
handler = new RequestHandler() {
35023502

@@ -3510,7 +3510,7 @@ public void handle(Request request, HttpServletResponse response) {
35103510
new FileWriter(file).append("hello").close();
35113511
InputStream input = new FileInputStream(file);
35123512
final AtomicInteger tx = new AtomicInteger(0);
3513-
UploadProgressCallback progress = new UploadProgressCallback() {
3513+
UploadProgress progress = new UploadProgress() {
35143514
public void onUpload(int transferred, int total) {
35153515
assertEquals(0, total);
35163516
assertEquals(tx.incrementAndGet(), transferred);
@@ -3526,7 +3526,7 @@ public void onUpload(int transferred, int total) {
35263526
* @throws Exception
35273527
*/
35283528
@Test
3529-
public void uploadProgressCallbackSendReader() throws Exception {
3529+
public void uploadProgressSendReader() throws Exception {
35303530
final AtomicReference<String> body = new AtomicReference<String>();
35313531
handler = new RequestHandler() {
35323532

@@ -3538,7 +3538,7 @@ public void handle(Request request, HttpServletResponse response) {
35383538
};
35393539

35403540
final AtomicInteger tx = new AtomicInteger(0);
3541-
UploadProgressCallback progress = new UploadProgressCallback() {
3541+
UploadProgress progress = new UploadProgress() {
35423542
public void onUpload(int transferred, int total) {
35433543
assertEquals(-1, total);
35443544
assertEquals(tx.incrementAndGet(), transferred);
@@ -3556,7 +3556,7 @@ public void onUpload(int transferred, int total) {
35563556
* @throws Exception
35573557
*/
35583558
@Test
3559-
public void nullUploadProgressCallback() throws Exception {
3559+
public void nullUploadProgress() throws Exception {
35603560
final AtomicReference<String> body = new AtomicReference<String>();
35613561
handler = new RequestHandler() {
35623562

0 commit comments

Comments
 (0)