@Test public void testBuildCanonicalHeaders() { StringBuilder sb = new StringBuilder(); S3V4Authentication.buildCanonicalHeaders(headersRequest, SIGNED_HEADERS, sb); assertEquals(CANONICAL_HEADERS, sb.toString()); }
static void buildCanonicalHeaders(MappingHttpRequest request, String signedHeaders, StringBuilder sb) { for (String header : signedHeaders.split(";")) { List<String> values = Lists.transform(request.getHeaders(header), text -> text != null ? text.trim() : null); sb.append(header.toLowerCase()); sb.append(':'); sb.append(Joiner.on(',').join(Ordering.<String>natural().sortedCopy(values))); sb.append('\n'); } }
S3V4Authentication { static void buildCanonicalHeaders(MappingHttpRequest request, String signedHeaders, StringBuilder sb) { for (String header : signedHeaders.split(";")) { List<String> values = Lists.transform(request.getHeaders(header), text -> text != null ? text.trim() : null); sb.append(header.toLowerCase()); sb.append(':'); sb.append(Joiner.on(',').join(Ordering.<String>natural().sortedCopy(values))); sb.append('\n'); } } }
S3V4Authentication { static void buildCanonicalHeaders(MappingHttpRequest request, String signedHeaders, StringBuilder sb) { for (String header : signedHeaders.split(";")) { List<String> values = Lists.transform(request.getHeaders(header), text -> text != null ? text.trim() : null); sb.append(header.toLowerCase()); sb.append(':'); sb.append(Joiner.on(',').join(Ordering.<String>natural().sortedCopy(values))); sb.append('\n'); } } private  S3V4Authentication(); }
S3V4Authentication { static void buildCanonicalHeaders(MappingHttpRequest request, String signedHeaders, StringBuilder sb) { for (String header : signedHeaders.split(";")) { List<String> values = Lists.transform(request.getHeaders(header), text -> text != null ? text.trim() : null); sb.append(header.toLowerCase()); sb.append(':'); sb.append(Joiner.on(',').join(Ordering.<String>natural().sortedCopy(values))); sb.append('\n'); } } private  S3V4Authentication();  }
S3V4Authentication { static void buildCanonicalHeaders(MappingHttpRequest request, String signedHeaders, StringBuilder sb) { for (String header : signedHeaders.split(";")) { List<String> values = Lists.transform(request.getHeaders(header), text -> text != null ? text.trim() : null); sb.append(header.toLowerCase()); sb.append(':'); sb.append(Joiner.on(',').join(Ordering.<String>natural().sortedCopy(values))); sb.append('\n'); } } private  S3V4Authentication();  static final String AWS_V4_AUTH_TYPE; static final String AWS_CONTENT_SHA_HEADER; static final String AWS_EXPIRES_PARAM; static final String AWS_DECODED_CONTENT_LEN; static final String STREAMING_PAYLOAD; static final String UNSIGNED_PAYLOAD; }