Skip to content

Commit cc8b2a5

Browse files
committed
remove unused files and method
1 parent 5f4fc12 commit cc8b2a5

File tree

15 files changed

+91
-1283
lines changed

15 files changed

+91
-1283
lines changed

clients/algoliasearch-client-java-2/.openapi-generator-ignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,6 @@ settings.gradle
1919
# Selective source file
2020
algoliasearch-core/com/algolia/auth/**
2121
algoliasearch-core/com/algolia/Configuration.java
22+
algoliasearch-core/com/algolia/Server*.java
23+
algoliasearch-core/com/algolia/StringUtil.java
24+
algoliasearch-core/com/algolia/GzipRequestInterceptor.java

clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ApiClient.java

Lines changed: 7 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,11 @@ public class ApiClient {
3030

3131
private boolean debugging = false;
3232
private Map<String, String> defaultHeaderMap = new HashMap<String, String>();
33-
private Map<String, String> defaultCookieMap = new HashMap<String, String>();
3433

3534
private String basePath;
3635
private String appId, apiKey;
3736

3837
private DateFormat dateFormat;
39-
private DateFormat datetimeFormat;
40-
private boolean lenientDatetimeFormat;
41-
private int dateLength;
4238

4339
private InputStream sslCaCert;
4440
private boolean verifyingSsl;
@@ -207,18 +203,6 @@ public ApiClient addDefaultHeader(String key, String value) {
207203
return this;
208204
}
209205

210-
/**
211-
* Add a default cookie.
212-
*
213-
* @param key The cookie's key
214-
* @param value The cookie's value
215-
* @return ApiClient
216-
*/
217-
public ApiClient addDefaultCookie(String key, String value) {
218-
defaultCookieMap.put(key, value);
219-
return this;
220-
}
221-
222206
/**
223207
* Check that whether debugging is enabled for this API client.
224208
*
@@ -515,7 +499,11 @@ public String selectHeaderAccept(String[] accepts) {
515499
return accept;
516500
}
517501
}
518-
return StringUtil.join(accepts, ",");
502+
StringJoiner joiner = new StringJoiner(",");
503+
for (String s : accepts) {
504+
joiner.add(s);
505+
}
506+
return joiner.toString();
519507
}
520508

521509
/**
@@ -812,9 +800,6 @@ public <T> T handleResponse(Response response, Type returnType)
812800
* @param collectionQueryParams The collection query parameters
813801
* @param body The request body object
814802
* @param headerParams The header parameters
815-
* @param cookieParams The cookie parameters
816-
* @param formParams The form parameters
817-
* @param authNames The authentications to apply
818803
* @param callback Callback for upload/download progress
819804
* @return The HTTP call
820805
* @throws ApiException If fail to serialize the request body object
@@ -826,9 +811,6 @@ public Call buildCall(
826811
List<Pair> collectionQueryParams,
827812
Object body,
828813
Map<String, String> headerParams,
829-
Map<String, String> cookieParams,
830-
Map<String, Object> formParams,
831-
String[] authNames,
832814
ApiCallback callback
833815
) throws ApiException {
834816
Request request = buildRequest(
@@ -838,9 +820,6 @@ public Call buildCall(
838820
collectionQueryParams,
839821
body,
840822
headerParams,
841-
cookieParams,
842-
formParams,
843-
authNames,
844823
callback
845824
);
846825

@@ -857,9 +836,6 @@ public Call buildCall(
857836
* @param collectionQueryParams The collection query parameters
858837
* @param body The request body object
859838
* @param headerParams The header parameters
860-
* @param cookieParams The cookie parameters
861-
* @param formParams The form parameters
862-
* @param authNames The authentications to apply
863839
* @param callback Callback for upload/download progress
864840
* @return The HTTP request
865841
* @throws ApiException If fail to serialize the request body object
@@ -871,17 +847,14 @@ public Request buildRequest(
871847
List<Pair> collectionQueryParams,
872848
Object body,
873849
Map<String, String> headerParams,
874-
Map<String, String> cookieParams,
875-
Map<String, Object> formParams,
876-
String[] authNames,
877850
ApiCallback callback
878851
) throws ApiException {
879-
updateParamsForAuth(authNames, queryParams, headerParams, cookieParams);
852+
headerParams.put("X-Algolia-Application-Id", this.appId);
853+
headerParams.put("X-Algolia-API-Key", this.apiKey);
880854

881855
final String url = buildUrl(path, queryParams, collectionQueryParams);
882856
final Request.Builder reqBuilder = new Request.Builder().url(url);
883857
processHeaderParams(headerParams, reqBuilder);
884-
processCookieParams(cookieParams, reqBuilder);
885858

886859
String contentType = (String) headerParams.get("Content-Type");
887860
// ensuring a default content type
@@ -892,10 +865,6 @@ public Request buildRequest(
892865
RequestBody reqBody;
893866
if (!HttpMethod.permitsRequestBody(method)) {
894867
reqBody = null;
895-
} else if ("application/x-www-form-urlencoded".equals(contentType)) {
896-
reqBody = buildRequestBodyFormEncoding(formParams);
897-
} else if ("multipart/form-data".equals(contentType)) {
898-
reqBody = buildRequestBodyMultipart(formParams);
899868
} else if (body == null) {
900869
if ("DELETE".equals(method)) {
901870
// allow calling DELETE without sending a request body
@@ -1006,50 +975,6 @@ public void processHeaderParams(
1006975
}
1007976
}
1008977

1009-
/**
1010-
* Set cookie parameters to the request builder, including default cookies.
1011-
*
1012-
* @param cookieParams Cookie parameters in the form of Map
1013-
* @param reqBuilder Request.Builder
1014-
*/
1015-
public void processCookieParams(
1016-
Map<String, String> cookieParams,
1017-
Request.Builder reqBuilder
1018-
) {
1019-
for (Entry<String, String> param : cookieParams.entrySet()) {
1020-
reqBuilder.addHeader(
1021-
"Cookie",
1022-
String.format("%s=%s", param.getKey(), param.getValue())
1023-
);
1024-
}
1025-
for (Entry<String, String> param : defaultCookieMap.entrySet()) {
1026-
if (!cookieParams.containsKey(param.getKey())) {
1027-
reqBuilder.addHeader(
1028-
"Cookie",
1029-
String.format("%s=%s", param.getKey(), param.getValue())
1030-
);
1031-
}
1032-
}
1033-
}
1034-
1035-
/**
1036-
* Update query and header parameters based on authentication settings.
1037-
*
1038-
* @param authNames The authentications to apply
1039-
* @param queryParams List of query parameters
1040-
* @param headerParams Map of header parameters
1041-
* @param cookieParams Map of cookie parameters
1042-
*/
1043-
public void updateParamsForAuth(
1044-
String[] authNames,
1045-
List<Pair> queryParams,
1046-
Map<String, String> headerParams,
1047-
Map<String, String> cookieParams
1048-
) {
1049-
headerParams.put("X-Algolia-Application-Id", this.appId);
1050-
headerParams.put("X-Algolia-API-Key", this.apiKey);
1051-
}
1052-
1053978
/**
1054979
* Build a form-encoding request body with the given form parameters.
1055980
*

clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/GzipRequestInterceptor.java

Lines changed: 0 additions & 80 deletions
This file was deleted.

clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ServerConfiguration.java

Lines changed: 0 additions & 71 deletions
This file was deleted.

clients/algoliasearch-client-java-2/algoliasearch-core/com/algolia/ServerVariable.java

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)