/** * Returns the values of the headers with the specified {@code name}. * * @param name the name of the headers * @return A {@link List} of header values which will be empty if no values * are found */ public ImmutableList<String> headers(CharSequence name) { return headers.getAll(name); }
@Override public List<String> headers(CharSequence name) { return headers.getAll(name); }
@Override public List<String> headers(CharSequence name) { return headers.getAll(name); }
@Override public List<String> headers(CharSequence name) { return headers.getAll(name); }
/** * Returns the values of the headers with the specified {@code name}. * * @param name the name of the headers * @return A {@link List} of header values which will be empty if no values * are found */ public ImmutableList<String> headers(CharSequence name) { return headers.getAll(name); }
/** * @param name header name * @return all values for a given HTTP header name or an empty list if the header is not present */ @Override public List<String> headers(CharSequence name) { return headers.getAll(name); }
public static boolean chunked(HttpHeaders headers) { for (String value : headers.getAll(TRANSFER_ENCODING)) { if (value.equalsIgnoreCase(CHUNKED.toString())) { return true; } } return false; }
public static boolean chunked(HttpHeaders headers) { for (String value : headers.getAll(TRANSFER_ENCODING)) { if (value.equalsIgnoreCase(CHUNKED.toString())) { return true; } } return false; }
private Optional<String> requireNotDuplicatedHeader(CharSequence headerName) { List<String> headerValues = headers.build().getAll(headerName); checkArgument(headerValues.size() <= 1, "Duplicate %s found. %s", headerName, headerValues); return headerValues.isEmpty() ? Optional.empty() : Optional.of(headerValues.get(0)); }
/** * Decodes "Set-Cookie" header values and returns them as set of {@link ResponseCookie} objects. * * @return a set of {@link ResponseCookie} objects */ public Set<ResponseCookie> cookies() { return decode(headers.getAll(SET_COOKIE)); }
/** * Decodes the "Set-Cookie" headers in this response and returns the cookies. * * @return a set of cookies */ public Set<ResponseCookie> cookies() { return decode(headers.getAll(SET_COOKIE)); }
/** * Returns the values of the headers with the specified {@code name}. * * @param name the name of the headers * @return A {@link List} of header values which will be empty if no values are found */ default List<String> headers(CharSequence name) { return headers().getAll(name); }
/** * Returns the values of the headers with the specified {@code name}. * * @param name the name of the headers * @return A {@link List} of header values which will be empty if no values are found */ default List<String> headers(CharSequence name) { return headers().getAll(name); }
/** * Returns the values of the headers with the specified {@code name}. * * @param name the name of the headers * @return A {@link List} of header values which will be empty if no values are found */ default List<String> headers(CharSequence name) { return headers().getAll(name); }
/** * Returns the values of the headers with the specified {@code name}. * * @param name the name of the headers * @return A {@link List} of header values which will be empty if no values are found */ default List<String> headers(CharSequence name) { return headers().getAll(name); }
Builder ensureContentLengthIsValid() { List<String> contentLengths = headers.build().getAll(CONTENT_LENGTH); checkArgument(contentLengths.size() <= 1, "Duplicate Content-Length found. %s", contentLengths); if (contentLengths.size() == 1) { checkArgument(isInteger(contentLengths.get(0)), "Invalid Content-Length found. %s", contentLengths.get(0)); } return this; }
Builder ensureContentLengthIsValid() { List<String> contentLengths = headers.build().getAll(CONTENT_LENGTH); checkArgument(contentLengths.size() <= 1, "Duplicate Content-Length found. %s", contentLengths); if (contentLengths.size() == 1) { checkArgument(isInteger(contentLengths.get(0)), "Invalid Content-Length found. %s", contentLengths.get(0)); } return this; }
Builder ensureContentLengthIsValid() { List<String> contentLengths = headers.build().getAll(CONTENT_LENGTH); checkArgument(contentLengths.size() <= 1, "Duplicate Content-Length found. %s", contentLengths); if (contentLengths.size() == 1) { checkArgument(isNonNegativeInteger(contentLengths.get(0)), "Invalid Content-Length found. %s", contentLengths.get(0)); } return this; }
Builder ensureContentLengthIsValid() { List<String> contentLengths = headers.build().getAll(CONTENT_LENGTH); checkArgument(contentLengths.size() <= 1, "Duplicate Content-Length found. %s", contentLengths); if (contentLengths.size() == 1) { checkArgument(isNonNegativeInteger(contentLengths.get(0)), "Invalid Content-Length found. %s", contentLengths.get(0)); } return this; }
private void ensureContentLengthIsValid() { List<String> contentLengths = headers.build().getAll(CONTENT_LENGTH); checkArgument(contentLengths.size() <= 1, "Duplicate Content-Length found. %s", contentLengths); if (contentLengths.size() == 1) { checkArgument(isInteger(contentLengths.get(0)), "Invalid Content-Length found. %s", contentLengths.get(0)); } }