@@ -61,7 +61,6 @@ public class ApiClient {
6161 private HttpLoggingInterceptor loggingInterceptor ;
6262
6363 private String accessToken ;
64- private String refreshToken ;
6564 private String appKey ;
6665 private String appSid ;
6766
@@ -241,17 +240,6 @@ public ApiClient setAccessToken(String accessToken) {
241240 this .accessToken = accessToken ;
242241 return this ;
243242 }
244-
245- /**
246- * Set refresh token for the OAuth2 authentication.
247- *
248- * @param refreshToken Access token
249- * @return An instance of OkHttpClient
250- */
251- public ApiClient setRefreshToken (String refreshToken ) {
252- this .refreshToken = refreshToken ;
253- return this ;
254- }
255243
256244 /**
257245 * Set the User-Agent header's value (by adding to the default header map).
@@ -809,7 +797,7 @@ public void onFailure(Request request, IOException e) {
809797 }
810798
811799 @ Override
812- public void onResponse (Response response ) throws IOException {
800+ public void onResponse (Response response ) {
813801 T result ;
814802 try {
815803 result = (T ) handleResponse (response , returnType );
@@ -881,7 +869,7 @@ public <T> T handleResponse(Response response, Type returnType) throws ApiExcept
881869 * @return The HTTP call
882870 * @throws ApiException If fail to serialize the request body object
883871 */
884- public Call buildCall (String path , String method , List <Pair > queryParams , List <Pair > collectionQueryParams , Object body , Map <String , String > headerParams , Map <String , Object > formParams , String [] authNames , ProgressRequestBody .ProgressRequestListener progressRequestListener ) throws ApiException , IOException {
872+ public Call buildCall (String path , String method , List <Pair > queryParams , List <Pair > collectionQueryParams , Object body , Map <String , String > headerParams , Map <String , Object > formParams , String [] authNames , ProgressRequestBody .ProgressRequestListener progressRequestListener ) throws ApiException {
885873 Request request = buildRequest (path , method , queryParams , collectionQueryParams , body , headerParams , formParams , authNames , progressRequestListener );
886874
887875 return httpClient .newCall (request );
@@ -902,7 +890,7 @@ public Call buildCall(String path, String method, List<Pair> queryParams, List<P
902890 * @return The HTTP request
903891 * @throws ApiException If fail to serialize the request body object
904892 */
905- public Request buildRequest (String path , String method , List <Pair > queryParams , List <Pair > collectionQueryParams , Object body , Map <String , String > headerParams , Map <String , Object > formParams , String [] authNames , ProgressRequestBody .ProgressRequestListener progressRequestListener ) throws ApiException , IOException {
893+ public Request buildRequest (String path , String method , List <Pair > queryParams , List <Pair > collectionQueryParams , Object body , Map <String , String > headerParams , Map <String , Object > formParams , String [] authNames , ProgressRequestBody .ProgressRequestListener progressRequestListener ) throws ApiException {
906894 addOAuthAuthentication (headerParams );
907895 final String url = buildUrl (path , queryParams , collectionQueryParams );
908896 final Request .Builder reqBuilder = new Request .Builder ().url (url );
@@ -1040,7 +1028,7 @@ public RequestBody buildRequestBodyFormEncoding(Map<String, Object> formParams)
10401028 * @param formParams Form parameters in the form of Map
10411029 * @return RequestBody
10421030 */
1043- public RequestBody buildRequestBodyMultipart (Map <String , Object > formParams ) throws IOException {
1031+ public RequestBody buildRequestBodyMultipart (Map <String , Object > formParams ) {
10441032 MultipartBuilder mpBuilder = new MultipartBuilder ().type (MultipartBuilder .FORM );
10451033 for (Entry <String , Object > param : formParams .entrySet ()) {
10461034 if (param .getValue () instanceof byte []) {
@@ -1063,8 +1051,14 @@ public RequestBody buildRequestBodyMultipart(Map<String, Object> formParams) thr
10631051 * @param file The given file
10641052 * @return The guessed Content-Type
10651053 */
1066- public String guessContentTypeFromFile (byte [] file ) throws IOException {
1067- String contentType = URLConnection .guessContentTypeFromStream (new ByteArrayInputStream (file ));
1054+ public String guessContentTypeFromFile (byte [] file ) {
1055+ String contentType = null ;
1056+ try {
1057+ contentType = URLConnection .guessContentTypeFromStream (new ByteArrayInputStream (file ));
1058+ }
1059+ catch (IOException e ) {
1060+ e .printStackTrace ();
1061+ }
10681062 if (contentType == null ) {
10691063 return "application/octet-stream" ;
10701064 }
0 commit comments