|
|
@ -37,10 +37,12 @@ public class ResponseHandler { |
|
|
|
private final boolean dismiss404; |
|
|
|
private final boolean dismiss404; |
|
|
|
private final boolean closeAfterDecode; |
|
|
|
private final boolean closeAfterDecode; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private final boolean decodeVoid; |
|
|
|
|
|
|
|
|
|
|
|
private final ResponseInterceptor responseInterceptor; |
|
|
|
private final ResponseInterceptor responseInterceptor; |
|
|
|
|
|
|
|
|
|
|
|
public ResponseHandler(Level logLevel, Logger logger, Decoder decoder, |
|
|
|
public ResponseHandler(Level logLevel, Logger logger, Decoder decoder, |
|
|
|
ErrorDecoder errorDecoder, boolean dismiss404, boolean closeAfterDecode, |
|
|
|
ErrorDecoder errorDecoder, boolean dismiss404, boolean closeAfterDecode, boolean decodeVoid, |
|
|
|
ResponseInterceptor responseInterceptor) { |
|
|
|
ResponseInterceptor responseInterceptor) { |
|
|
|
super(); |
|
|
|
super(); |
|
|
|
this.logLevel = logLevel; |
|
|
|
this.logLevel = logLevel; |
|
|
@ -50,6 +52,7 @@ public class ResponseHandler { |
|
|
|
this.dismiss404 = dismiss404; |
|
|
|
this.dismiss404 = dismiss404; |
|
|
|
this.closeAfterDecode = closeAfterDecode; |
|
|
|
this.closeAfterDecode = closeAfterDecode; |
|
|
|
this.responseInterceptor = responseInterceptor; |
|
|
|
this.responseInterceptor = responseInterceptor; |
|
|
|
|
|
|
|
this.decodeVoid = decodeVoid; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public Object handleResponse(String configKey, |
|
|
|
public Object handleResponse(String configKey, |
|
|
@ -113,7 +116,7 @@ public class ResponseHandler { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private Object decode(Response response, Type type) throws IOException { |
|
|
|
private Object decode(Response response, Type type) throws IOException { |
|
|
|
if (isVoidType(type)) { |
|
|
|
if (isVoidType(type) && !decodeVoid) { |
|
|
|
ensureClosed(response.body()); |
|
|
|
ensureClosed(response.body()); |
|
|
|
return null; |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|