22 * Kripo API
33 * API to interact with Kripo fragment, fingerprint and similarity data files.
44 *
5- * OpenAPI spec version: 2.4.0
5+ * OpenAPI spec version: 2.3.1
66 *
77 *
88 * NOTE: This class is auto generated by the swagger code generator program.
@@ -127,6 +127,7 @@ public class ApiClient {
127127
128128 private InputStream sslCaCert ;
129129 private boolean verifyingSsl ;
130+ private KeyManager [] keyManagers ;
130131
131132 private OkHttpClient httpClient ;
132133 private JSON json ;
@@ -139,6 +140,7 @@ public class ApiClient {
139140 public ApiClient () {
140141 httpClient = new OkHttpClient ();
141142
143+
142144 verifyingSsl = true ;
143145
144146 json = new JSON (this );
@@ -270,6 +272,23 @@ public ApiClient setSslCaCert(InputStream sslCaCert) {
270272 return this ;
271273 }
272274
275+ public KeyManager [] getKeyManagers () {
276+ return keyManagers ;
277+ }
278+
279+ /**
280+ * Configure client keys to use for authorization in an SSL session.
281+ * Use null to reset to default.
282+ *
283+ * @param managers The KeyManagers to use
284+ * @return ApiClient
285+ */
286+ public ApiClient setKeyManagers (KeyManager [] managers ) {
287+ this .keyManagers = managers ;
288+ applySslSettings ();
289+ return this ;
290+ }
291+
273292 public DateFormat getDateFormat () {
274293 return dateFormat ;
275294 }
@@ -723,12 +742,13 @@ public String sanitizeFilename(String filename) {
723742 * application/json
724743 * application/json; charset=UTF8
725744 * APPLICATION/JSON
726- *
745+ * application/vnd.company+json
727746 * @param mime MIME (Multipurpose Internet Mail Extensions)
728747 * @return True if the given MIME is JSON, false otherwise.
729748 */
730749 public boolean isJsonMime (String mime ) {
731- return mime != null && mime .matches ("(?i)application\\ /json(;.*)?" );
750+ String jsonMime = "(?i)^(application/json|[^;/ \t ]+/[^;/ \t ]+[+]json)[ \t ]*(;.*)?$" ;
751+ return mime != null && (mime .matches (jsonMime ) || mime .equalsIgnoreCase ("application/json-patch+json" ));
732752 }
733753
734754 /**
@@ -1030,6 +1050,13 @@ public <T> T handleResponse(Response response, Type returnType) throws ApiExcept
10301050 if (returnType == null || response .code () == 204 ) {
10311051 // returning null if the returnType is not defined,
10321052 // or the status code is 204 (No Content)
1053+ if (response .body () != null ) {
1054+ try {
1055+ response .body ().close ();
1056+ } catch (IOException e ) {
1057+ throw new ApiException (response .message (), e , response .code (), response .headers ().toMultimap ());
1058+ }
1059+ }
10331060 return null ;
10341061 } else {
10351062 return deserialize (response , returnType );
@@ -1062,6 +1089,26 @@ public <T> T handleResponse(Response response, Type returnType) throws ApiExcept
10621089 * @throws ApiException If fail to serialize the request body object
10631090 */
10641091 public Call buildCall (String path , String method , List <Pair > queryParams , Object body , Map <String , String > headerParams , Map <String , Object > formParams , String [] authNames , ProgressRequestBody .ProgressRequestListener progressRequestListener ) throws ApiException {
1092+ Request request = buildRequest (path , method , queryParams , body , headerParams , formParams , authNames , progressRequestListener );
1093+
1094+ return httpClient .newCall (request );
1095+ }
1096+
1097+ /**
1098+ * Build an HTTP request with the given options.
1099+ *
1100+ * @param path The sub-path of the HTTP URL
1101+ * @param method The request method, one of "GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH" and "DELETE"
1102+ * @param queryParams The query parameters
1103+ * @param body The request body object
1104+ * @param headerParams The header parameters
1105+ * @param formParams The form parameters
1106+ * @param authNames The authentications to apply
1107+ * @param progressRequestListener Progress request listener
1108+ * @return The HTTP request
1109+ * @throws ApiException If fail to serialize the request body object
1110+ */
1111+ public Request buildRequest (String path , String method , List <Pair > queryParams , Object body , Map <String , String > headerParams , Map <String , Object > formParams , String [] authNames , ProgressRequestBody .ProgressRequestListener progressRequestListener ) throws ApiException {
10651112 updateParamsForAuth (authNames , queryParams , headerParams );
10661113
10671114 final String url = buildUrl (path , queryParams );
@@ -1102,7 +1149,7 @@ public Call buildCall(String path, String method, List<Pair> queryParams, Object
11021149 request = reqBuilder .method (method , reqBody ).build ();
11031150 }
11041151
1105- return httpClient . newCall ( request ) ;
1152+ return request ;
11061153 }
11071154
11081155 /**
@@ -1251,7 +1298,6 @@ private void initDatetimeFormat() {
12511298 */
12521299 private void applySslSettings () {
12531300 try {
1254- KeyManager [] keyManagers = null ;
12551301 TrustManager [] trustManagers = null ;
12561302 HostnameVerifier hostnameVerifier = null ;
12571303 if (!verifyingSsl ) {
0 commit comments