/** * Returns an immutable map of parameterized HTTP header value(s) for this {@code BodyPart}, * keyed by header name. Key comparisons in the returned map must be case-insensitive. If you wish to modify the headers * map for this {@code BodyPart}, modify the map returned by {@code getHeaders()} instead. * * @return immutable map of HTTP header values. * @throws ParseException if an un-expected/in-correct value is found during parsing the headers. */ public MultivaluedMap<String, ParameterizedHeader> getParameterizedHeaders() throws ParseException { return new ImmutableMultivaluedMap<>(new ParameterizedHeadersMap(headers)); }
/** * Create new parameterized headers map from given headers. * * @param headers headers to initialize this map from. * @throws ParseException if an un-expected/in-correct value is found during parsing the headers. */ public ParameterizedHeadersMap(final MultivaluedMap<String, String> headers) throws ParseException { for (Map.Entry<String, List<String>> entry : headers.entrySet()) { List<ParameterizedHeader> list = new ArrayList<ParameterizedHeader>(entry.getValue().size()); for (String value : entry.getValue()) { list.add(new ParameterizedHeader(value)); } this.put(entry.getKey(), list); } }
/** * Returns an immutable map of parameterized HTTP header value(s) for this {@code BodyPart}, * keyed by header name. Key comparisons in the returned map must be case-insensitive. If you wish to modify the headers * map for this {@code BodyPart}, modify the map returned by {@code getHeaders()} instead. * * @return immutable map of HTTP header values. * @throws ParseException if an un-expected/in-correct value is found during parsing the headers. */ public MultivaluedMap<String, ParameterizedHeader> getParameterizedHeaders() throws ParseException { return new ImmutableMultivaluedMap<>(new ParameterizedHeadersMap(headers)); }
/** * Create new parameterized headers map from given headers. * * @param headers headers to initialize this map from. * @throws ParseException if an un-expected/in-correct value is found during parsing the headers. */ public ParameterizedHeadersMap(final MultivaluedMap<String, String> headers) throws ParseException { for (Map.Entry<String, List<String>> entry : headers.entrySet()) { List<ParameterizedHeader> list = new ArrayList<ParameterizedHeader>(entry.getValue().size()); for (String value : entry.getValue()) { list.add(new ParameterizedHeader(value)); } this.put(entry.getKey(), list); } }
/** * Returns an immutable map of parameterized HTTP header value(s) for this {@code BodyPart}, * keyed by header name. Key comparisons in the returned map must be case-insensitive. If you wish to modify the headers * map for this {@code BodyPart}, modify the map returned by {@code getHeaders()} instead. * * @return immutable map of HTTP header values. * @throws ParseException if an un-expected/in-correct value is found during parsing the headers. */ public MultivaluedMap<String, ParameterizedHeader> getParameterizedHeaders() throws ParseException { return new ImmutableMultivaluedMap<>(new ParameterizedHeadersMap(headers)); }
/** * Create new parameterized headers map from given headers. * * @param headers headers to initialize this map from. * @throws ParseException if an un-expected/in-correct value is found during parsing the headers. */ public ParameterizedHeadersMap(final MultivaluedMap<String, String> headers) throws ParseException { for (Map.Entry<String, List<String>> entry : headers.entrySet()) { List<ParameterizedHeader> list = new ArrayList<ParameterizedHeader>(entry.getValue().size()); for (String value : entry.getValue()) { list.add(new ParameterizedHeader(value)); } this.put(entry.getKey(), list); } }
/** * Returns an immutable map of parameterized HTTP header value(s) for this {@code BodyPart}, * keyed by header name. Key comparisons in the returned map must be case-insensitive. If you wish to modify the headers * map for this {@code BodyPart}, modify the map returned by {@code getHeaders()} instead. * * @return immutable map of HTTP header values. * @throws ParseException if an un-expected/in-correct value is found during parsing the headers. */ public MultivaluedMap<String, ParameterizedHeader> getParameterizedHeaders() throws ParseException { return new ImmutableMultivaluedMap<>(new ParameterizedHeadersMap(headers)); }
/** * Create new parameterized headers map from given headers. * * @param headers headers to initialize this map from. * @throws ParseException if an un-expected/in-correct value is found during parsing the headers. */ public ParameterizedHeadersMap(final MultivaluedMap<String, String> headers) throws ParseException { for (Map.Entry<String, List<String>> entry : headers.entrySet()) { List<ParameterizedHeader> list = new ArrayList<ParameterizedHeader>(entry.getValue().size()); for (String value : entry.getValue()) { list.add(new ParameterizedHeader(value)); } this.put(entry.getKey(), list); } }
/** * Returns an immutable map of parameterized HTTP header value(s) for this {@code BodyPart}, * keyed by header name. Key comparisons in the returned map must be case-insensitive. If you wish to modify the headers * map for this {@code BodyPart}, modify the map returned by {@code getHeaders()} instead. * * @return immutable map of HTTP header values. * @throws ParseException if an un-expected/in-correct value is found during parsing the headers. */ public MultivaluedMap<String, ParameterizedHeader> getParameterizedHeaders() throws ParseException { return new ImmutableMultivaluedMap<>(new ParameterizedHeadersMap(headers)); }
/** * Create new parameterized headers map from given headers. * * @param headers headers to initialize this map from. * @throws ParseException if an un-expected/in-correct value is found during parsing the headers. */ public ParameterizedHeadersMap(final MultivaluedMap<String, String> headers) throws ParseException { for (Map.Entry<String, List<String>> entry : headers.entrySet()) { List<ParameterizedHeader> list = new ArrayList<ParameterizedHeader>(entry.getValue().size()); for (String value : entry.getValue()) { list.add(new ParameterizedHeader(value)); } this.put(entry.getKey(), list); } }