From ba1b341796498d831a06ee814ec2d8a89f38c0b5 Mon Sep 17 00:00:00 2001 From: Louis Chu Date: Mon, 1 Apr 2024 13:20:13 -0700 Subject: [PATCH] Update file format Signed-off-by: Louis Chu --- .../AWSRequestSigningApacheInterceptor.java | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/flint-core/src/main/scala/org/opensearch/flint/core/auth/AWSRequestSigningApacheInterceptor.java b/flint-core/src/main/scala/org/opensearch/flint/core/auth/AWSRequestSigningApacheInterceptor.java index 86a1b7040..c11677c3f 100644 --- a/flint-core/src/main/scala/org/opensearch/flint/core/auth/AWSRequestSigningApacheInterceptor.java +++ b/flint-core/src/main/scala/org/opensearch/flint/core/auth/AWSRequestSigningApacheInterceptor.java @@ -59,8 +59,8 @@ public class AWSRequestSigningApacheInterceptor implements HttpRequestIntercepto * @param awsCredentialsProvider source of AWS credentials for signing */ public AWSRequestSigningApacheInterceptor(final String service, - final Signer signer, - final AWSCredentialsProvider awsCredentialsProvider) { + final Signer signer, + final AWSCredentialsProvider awsCredentialsProvider) { this.service = service; this.signer = signer; this.awsCredentialsProvider = awsCredentialsProvider; @@ -71,7 +71,7 @@ public AWSRequestSigningApacheInterceptor(final String service, */ @Override public void process(final HttpRequest request, final HttpContext context) - throws HttpException, IOException { + throws HttpException, IOException { URIBuilder uriBuilder; try { uriBuilder = new URIBuilder(request.getRequestLine().getUri()); @@ -87,7 +87,7 @@ public void process(final HttpRequest request, final HttpContext context) signableRequest.setEndpoint(URI.create(host.toURI())); } final HttpMethodName httpMethod = - HttpMethodName.fromValue(request.getRequestLine().getMethod()); + HttpMethodName.fromValue(request.getRequestLine().getMethod()); signableRequest.setHttpMethod(httpMethod); try { signableRequest.setResourcePath(uriBuilder.build().getRawPath()); @@ -97,7 +97,7 @@ public void process(final HttpRequest request, final HttpContext context) if (request instanceof HttpEntityEnclosingRequest) { HttpEntityEnclosingRequest httpEntityEnclosingRequest = - (HttpEntityEnclosingRequest) request; + (HttpEntityEnclosingRequest) request; if (httpEntityEnclosingRequest.getEntity() != null) { signableRequest.setContent(httpEntityEnclosingRequest.getEntity().getContent()); } @@ -112,7 +112,7 @@ public void process(final HttpRequest request, final HttpContext context) request.setHeaders(mapToHeaderArray(signableRequest.getHeaders())); if (request instanceof HttpEntityEnclosingRequest) { HttpEntityEnclosingRequest httpEntityEnclosingRequest = - (HttpEntityEnclosingRequest) request; + (HttpEntityEnclosingRequest) request; if (httpEntityEnclosingRequest.getEntity() != null) { BasicHttpEntity basicHttpEntity = new BasicHttpEntity(); basicHttpEntity.setContent(signableRequest.getContent()); @@ -130,7 +130,7 @@ private static Map> nvpToMapParams(final List> parameterMap = new TreeMap<>(String.CASE_INSENSITIVE_ORDER); for (NameValuePair nvp : params) { List argsList = - parameterMap.computeIfAbsent(nvp.getName(), k -> new ArrayList<>()); + parameterMap.computeIfAbsent(nvp.getName(), k -> new ArrayList<>()); argsList.add(nvp.getValue()); } return parameterMap; @@ -156,8 +156,8 @@ private static Map headerArrayToMap(final Header[] headers) { */ private static boolean skipHeader(final Header header) { return ("content-length".equalsIgnoreCase(header.getName()) - && "0".equals(header.getValue())) // Strip Content-Length: 0 - || "host".equalsIgnoreCase(header.getName()); // Host comes from endpoint + && "0".equals(header.getValue())) // Strip Content-Length: 0 + || "host".equalsIgnoreCase(header.getName()); // Host comes from endpoint } /** @@ -172,4 +172,4 @@ private static Header[] mapToHeaderArray(final Map mapHeaders) { } return headers; } -} \ No newline at end of file +}