@Override public MultivaluedMap<String, String> readFrom( Class<MultivaluedMap<String, String>> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return readFrom(new NullableMultivaluedHashMap<String, String>(), mediaType, true, entityStream); }
@Override public MultivaluedMap<String, String> readFrom( Class<MultivaluedMap<String, String>> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return readFrom(new NullableMultivaluedHashMap<String, String>(), mediaType, true, entityStream); }
@Override public Form readFrom( Class<Form> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return new Form(readFrom(new NullableMultivaluedHashMap<String, String>(), mediaType, decode(annotations), entityStream)); }
@Override public Form readFrom( Class<Form> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return new Form(readFrom(new NullableMultivaluedHashMap<String, String>(), mediaType, decode(annotations), entityStream)); }
private Form switchUrlEncoding(final ContainerRequest request, final Form otherForm) { final Set<Map.Entry<String, List<String>>> entries = otherForm.asMap().entrySet(); MultivaluedMap<String, String> formMap = new NullableMultivaluedHashMap<>(); for (Map.Entry<String, List<String>> entry : entries) { final String charsetName = ReaderWriter.getCharset(MediaType.valueOf( request.getHeaderString(HttpHeaders.CONTENT_TYPE))).name(); String key; try { key = decode ? URLDecoder.decode(entry.getKey(), charsetName) : URLEncoder.encode(entry.getKey(), charsetName); for (String value : entry.getValue()) { if (value != null) { formMap.add(key, decode ? URLDecoder.decode(value, charsetName) : URLEncoder.encode(value, charsetName)); } else { formMap.add(key, null); } } } catch (UnsupportedEncodingException uee) { throw new ProcessingException(LocalizationMessages.ERROR_UNSUPPORTED_ENCODING(charsetName, extractor.getName()), uee); } } return new Form(formMap); }
private Form switchUrlEncoding(final ContainerRequest request, final Form otherForm) { final Set<Map.Entry<String, List<String>>> entries = otherForm.asMap().entrySet(); MultivaluedMap<String, String> formMap = new NullableMultivaluedHashMap<>(); for (Map.Entry<String, List<String>> entry : entries) { final String charsetName = ReaderWriter.getCharset(MediaType.valueOf( request.getHeaderString(HttpHeaders.CONTENT_TYPE))).name(); String key; try { key = decode ? URLDecoder.decode(entry.getKey(), charsetName) : URLEncoder.encode(entry.getKey(), charsetName); for (String value : entry.getValue()) { if (value != null) { formMap.add(key, decode ? URLDecoder.decode(value, charsetName) : URLEncoder.encode(value, charsetName)); } else { formMap.add(key, null); } } } catch (UnsupportedEncodingException uee) { throw new ProcessingException(LocalizationMessages.ERROR_UNSUPPORTED_ENCODING(charsetName, extractor.getName()), uee); } } return new Form(formMap); }
private Form switchUrlEncoding(final ContainerRequest request, final Form otherForm) { final Set<Map.Entry<String, List<String>>> entries = otherForm.asMap().entrySet(); MultivaluedMap<String, String> formMap = new NullableMultivaluedHashMap<>(); for (Map.Entry<String, List<String>> entry : entries) { final String charsetName = ReaderWriter.getCharset(MediaType.valueOf( request.getHeaderString(HttpHeaders.CONTENT_TYPE))).name(); String key; try { key = decode ? URLDecoder.decode(entry.getKey(), charsetName) : URLEncoder.encode(entry.getKey(), charsetName); for (String value : entry.getValue()) { if (value != null) { formMap.add(key, decode ? URLDecoder.decode(value, charsetName) : URLEncoder.encode(value, charsetName)); } else { formMap.add(key, null); } } } catch (UnsupportedEncodingException uee) { throw new ProcessingException(LocalizationMessages.ERROR_UNSUPPORTED_ENCODING(charsetName, extractor.getName()), uee); } } return new Form(formMap); }
@Override public MultivaluedMap<String, String> readFrom( Class<MultivaluedMap<String, String>> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return readFrom(new NullableMultivaluedHashMap<String, String>(), mediaType, true, entityStream); }
@Override public MultivaluedMap<String, String> readFrom( Class<MultivaluedMap<String, String>> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return readFrom(new NullableMultivaluedHashMap<String, String>(), mediaType, true, entityStream); }
@Override public MultivaluedMap<String, String> readFrom( Class<MultivaluedMap<String, String>> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return readFrom(new NullableMultivaluedHashMap<String, String>(), mediaType, true, entityStream); }
@Override public MultivaluedMap<String, String> readFrom( Class<MultivaluedMap<String, String>> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return readFrom(new NullableMultivaluedHashMap<String, String>(), mediaType, true, entityStream); }
@Override public MultivaluedMap<String, String> readFrom( Class<MultivaluedMap<String, String>> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return readFrom(new NullableMultivaluedHashMap<String, String>(), mediaType, true, entityStream); }
@Override public Form readFrom( Class<Form> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return new Form(readFrom(new NullableMultivaluedHashMap<String, String>(), mediaType, decode(annotations), entityStream)); }
@Override public Form readFrom( Class<Form> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return new Form(readFrom(new NullableMultivaluedHashMap<String, String>(), mediaType, decode(annotations), entityStream)); }
@Override public Form readFrom( Class<Form> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return new Form(readFrom(new NullableMultivaluedHashMap<String, String>(), mediaType, decode(annotations), entityStream)); }
@Override public Form readFrom( Class<Form> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return new Form(readFrom(new NullableMultivaluedHashMap<String, String>(), mediaType, decode(annotations), entityStream)); }
@Override public Form readFrom( Class<Form> type, Type genericType, Annotation annotations[], MediaType mediaType, MultivaluedMap<String, String> httpHeaders, InputStream entityStream) throws IOException { return new Form(readFrom(new NullableMultivaluedHashMap<String, String>(), mediaType, decode(annotations), entityStream)); }
private Form switchUrlEncoding(final ContainerRequest request, final Form otherForm) { final Set<Map.Entry<String, List<String>>> entries = otherForm.asMap().entrySet(); MultivaluedMap<String, String> formMap = new NullableMultivaluedHashMap<>(); for (Map.Entry<String, List<String>> entry : entries) { final String charsetName = ReaderWriter.getCharset(MediaType.valueOf( request.getHeaderString(HttpHeaders.CONTENT_TYPE))).name(); String key; try { key = decode ? URLDecoder.decode(entry.getKey(), charsetName) : URLEncoder.encode(entry.getKey(), charsetName); for (String value : entry.getValue()) { if (value != null) { formMap.add(key, decode ? URLDecoder.decode(value, charsetName) : URLEncoder.encode(value, charsetName)); } else { formMap.add(key, null); } } } catch (UnsupportedEncodingException uee) { throw new ProcessingException(LocalizationMessages.ERROR_UNSUPPORTED_ENCODING(charsetName, extractor.getName()), uee); } } return new Form(formMap); }
private Form switchUrlEncoding(final ContainerRequest request, final Form otherForm) { final Set<Map.Entry<String, List<String>>> entries = otherForm.asMap().entrySet(); MultivaluedMap<String, String> formMap = new NullableMultivaluedHashMap<>(); for (Map.Entry<String, List<String>> entry : entries) { final String charsetName = ReaderWriter.getCharset(MediaType.valueOf( request.getHeaderString(HttpHeaders.CONTENT_TYPE))).name(); String key; try { key = decode ? URLDecoder.decode(entry.getKey(), charsetName) : URLEncoder.encode(entry.getKey(), charsetName); for (String value : entry.getValue()) { if (value != null) { formMap.add(key, decode ? URLDecoder.decode(value, charsetName) : URLEncoder.encode(value, charsetName)); } else { formMap.add(key, null); } } } catch (UnsupportedEncodingException uee) { throw new ProcessingException(LocalizationMessages.ERROR_UNSUPPORTED_ENCODING(charsetName, extractor.getName()), uee); } } return new Form(formMap); }
private Form switchUrlEncoding(final ContainerRequest request, final Form otherForm) { final Set<Map.Entry<String, List<String>>> entries = otherForm.asMap().entrySet(); MultivaluedMap<String, String> formMap = new NullableMultivaluedHashMap<>(); for (Map.Entry<String, List<String>> entry : entries) { final String charsetName = ReaderWriter.getCharset(MediaType.valueOf( request.getHeaderString(HttpHeaders.CONTENT_TYPE))).name(); String key; try { key = decode ? URLDecoder.decode(entry.getKey(), charsetName) : URLEncoder.encode(entry.getKey(), charsetName); for (String value : entry.getValue()) { if (value != null) { formMap.add(key, decode ? URLDecoder.decode(value, charsetName) : URLEncoder.encode(value, charsetName)); } else { formMap.add(key, null); } } } catch (UnsupportedEncodingException uee) { throw new ProcessingException(LocalizationMessages.ERROR_UNSUPPORTED_ENCODING(charsetName, extractor.getName()), uee); } } return new Form(formMap); }