@@ -357,7 +357,7 @@ public <T> List<T> list(Class<T> cls) {
357
357
358
358
@ Override
359
359
public <T > Stream <T > stream (Class <T > cls ) {
360
- final HttpResponse <Stream <String >> res = withResponseHandler (HttpResponse .BodyHandlers .ofLines ());
360
+ final HttpResponse <Stream <String >> res = withHandler (HttpResponse .BodyHandlers .ofLines ());
361
361
this .httpResponse = res ;
362
362
if (res .statusCode () >= 300 ) {
363
363
throw new HttpException (res , context );
@@ -367,7 +367,7 @@ public <T> Stream<T> stream(Class<T> cls) {
367
367
}
368
368
369
369
@ Override
370
- public <T > HttpResponse <T > withResponseHandler (HttpResponse .BodyHandler <T > responseHandler ) {
370
+ public <T > HttpResponse <T > withHandler (HttpResponse .BodyHandler <T > responseHandler ) {
371
371
context .beforeRequest (this );
372
372
addHeaders ();
373
373
HttpResponse <T > response = performSend (responseHandler );
@@ -420,33 +420,33 @@ protected <E> HttpResponse<E> afterAsync(HttpResponse<E> response) {
420
420
421
421
@ Override
422
422
public HttpResponse <byte []> asByteArray () {
423
- return withResponseHandler (HttpResponse .BodyHandlers .ofByteArray ());
423
+ return withHandler (HttpResponse .BodyHandlers .ofByteArray ());
424
424
}
425
425
426
426
@ Override
427
427
public HttpResponse <String > asString () {
428
428
loggableResponseBody = true ;
429
- return withResponseHandler (HttpResponse .BodyHandlers .ofString ());
429
+ return withHandler (HttpResponse .BodyHandlers .ofString ());
430
430
}
431
431
432
432
@ Override
433
433
public HttpResponse <Void > asDiscarding () {
434
- return withResponseHandler (discarding ());
434
+ return withHandler (discarding ());
435
435
}
436
436
437
437
@ Override
438
438
public HttpResponse <InputStream > asInputStream () {
439
- return withResponseHandler (HttpResponse .BodyHandlers .ofInputStream ());
439
+ return withHandler (HttpResponse .BodyHandlers .ofInputStream ());
440
440
}
441
441
442
442
@ Override
443
443
public HttpResponse <Path > asFile (Path file ) {
444
- return withResponseHandler (HttpResponse .BodyHandlers .ofFile (file ));
444
+ return withHandler (HttpResponse .BodyHandlers .ofFile (file ));
445
445
}
446
446
447
447
@ Override
448
448
public HttpResponse <Stream <String >> asLines () {
449
- return withResponseHandler (HttpResponse .BodyHandlers .ofLines ());
449
+ return withHandler (HttpResponse .BodyHandlers .ofLines ());
450
450
}
451
451
452
452
private HttpRequest .Builder newReq (String url ) {
@@ -564,7 +564,7 @@ static class HttpVoidResponse implements HttpResponse<Void> {
564
564
565
565
private final HttpResponse <?> orig ;
566
566
567
- @ SuppressWarnings ({"unchecked" , " raw" })
567
+ @ SuppressWarnings ({"raw" })
568
568
HttpVoidResponse (HttpResponse <?> orig ) {
569
569
this .orig = orig ;
570
570
}
0 commit comments