public void decode(String query) { decodeTo(query,this,ENCODING); }
public void decode(String query,Charset charset) { decodeTo(query,this,charset); }
public UrlEncoded(String query) { decodeTo(query,this,ENCODING); }
/** Decoded parameters to Map. * @param content the string containing the encoded parameters * @param map the MultiMap to put parsed query parameters into * @param charset the charset to use for decoding */ public static void decodeTo(String content, MultiMap<String> map, String charset) { decodeTo(content,map,charset==null?null:Charset.forName(charset)); }
public static void decodeUtf16To(InputStream in, MultiMap<String> map, int maxLength, int maxKeys) throws IOException { InputStreamReader input = new InputStreamReader(in,StandardCharsets.UTF_16); StringWriter buf = new StringWriter(8192); IO.copy(input,buf,maxLength); // TODO implement maxKeys decodeTo(buf.getBuffer().toString(),map,StandardCharsets.UTF_16); }
/** Decoded parameters to Map. * @param in the stream containing the encoded parameters * @param map the MultiMap to decode into * @param charset the charset to use for decoding * @param maxLength the maximum length of the form to decode * @param maxKeys the maximum number of keys to decode * @throws IOException if unable to decode input stream */ public static void decodeTo(InputStream in, MultiMap<String> map, String charset, int maxLength, int maxKeys) throws IOException { if (charset==null) { if (ENCODING.equals(StandardCharsets.UTF_8)) decodeUtf8To(in,map,maxLength,maxKeys); else decodeTo(in,map,ENCODING,maxLength,maxKeys); } else if (StringUtil.__UTF8.equalsIgnoreCase(charset)) decodeUtf8To(in,map,maxLength,maxKeys); else if (StringUtil.__ISO_8859_1.equalsIgnoreCase(charset)) decode88591To(in,map,maxLength,maxKeys); else if (StringUtil.__UTF16.equalsIgnoreCase(charset)) decodeUtf16To(in,map,maxLength,maxKeys); else decodeTo(in,map,Charset.forName(charset),maxLength,maxKeys); }
/** Decoded parameters to Map. * @param content the string containing the encoded parameters */ public static void decodeTo(String content, MultiMap map, String charset) { decodeTo(content,map,charset,-1); }
/** Decoded parameters to Map. * @param content the string containing the encoded parameters */ public static void decodeTo(String content, MultiMap<String> map, String charset, int maxKeys) { decodeTo(content,map,charset==null?null:Charset.forName(charset),maxKeys); }
@Override public void decodeQueryTo(MultiMap parameters) { if (_query==_fragment) return; UrlEncoded.decodeTo(StringUtil.toString(_raw,_query+1,_fragment-_query-1,_encoding),parameters,_encoding); }
public void decodeQueryTo(MultiMap<String> parameters, Charset encoding) throws UnsupportedEncodingException { if (_query==null) return; if (encoding==null || StandardCharsets.UTF_8.equals(encoding)) UrlEncoded.decodeUtf8To(_query,parameters); else UrlEncoded.decodeTo(_query,parameters,encoding); }
public static void decodeUtf16To(InputStream in, MultiMap map, int maxLength, int maxKeys) throws IOException { InputStreamReader input = new InputStreamReader(in,StringUtil.__UTF16); StringWriter buf = new StringWriter(8192); IO.copy(input,buf,maxLength); decodeTo(buf.getBuffer().toString(),map,StringUtil.__UTF16,maxKeys); }
public void decodeQueryTo(MultiMap<String> parameters, Charset encoding) throws UnsupportedEncodingException { if (_query==_fragment) return; if (encoding==null || StandardCharsets.UTF_8.equals(encoding)) UrlEncoded.decodeUtf8To(_query,parameters); else UrlEncoded.decodeTo(_query,parameters,encoding); }
@Override public void decodeQueryTo(MultiMap parameters) { if (_query==_fragment) return; UrlEncoded.decodeTo(StringUtil.toString(_raw,_query+1,_fragment-_query-1,_encoding),parameters,_encoding); }
@Override public void decodeQueryTo(MultiMap parameters) { if (_query==_fragment) return; UrlEncoded.decodeTo(StringUtil.toString(_raw,_query+1,_fragment-_query-1,_encoding),parameters,_encoding); }
public static void decodeUtf16To(InputStream in, MultiMap map, int maxLength, int maxKeys) throws IOException { InputStreamReader input = new InputStreamReader(in,StringUtil.__UTF16); StringWriter buf = new StringWriter(8192); IO.copy(input,buf,maxLength); decodeTo(buf.getBuffer().toString(),map,StringUtil.__UTF16,maxKeys); }
@Override public void decodeQueryTo(MultiMap parameters, String encoding) throws UnsupportedEncodingException { if (_query==_fragment) return; if (encoding==null) encoding=_encoding; UrlEncoded.decodeTo(StringUtil.toString(_raw,_query+1,_fragment-_query-1,encoding),parameters,encoding); }
public void decodeQueryTo(MultiMap<String> parameters) { if (_query==_fragment) return; if (_charset==StringUtil.__UTF8_CHARSET) UrlEncoded.decodeUtf8To(_raw,_query+1,_fragment-_query-1,parameters); else UrlEncoded.decodeTo(StringUtil.toString(_raw,_query+1,_fragment-_query-1,_charset.toString()),parameters,_charset.toString(),-1); }
public void decodeQueryTo(MultiMap parameters, String encoding) throws UnsupportedEncodingException { if (_query==_fragment) return; if (encoding==null || StringUtil.isUTF8(encoding)) UrlEncoded.decodeUtf8To(_raw,_query+1,_fragment-_query-1,parameters); else UrlEncoded.decodeTo(StringUtil.toString(_raw,_query+1,_fragment-_query-1,encoding),parameters,encoding); }
public void decodeQueryTo(MultiMap parameters, String encoding) throws UnsupportedEncodingException { if (_query==_fragment) return; if (encoding==null || StringUtil.isUTF8(encoding)) UrlEncoded.decodeUtf8To(_raw,_query+1,_fragment-_query-1,parameters); else UrlEncoded.decodeTo(StringUtil.toString(_raw,_query+1,_fragment-_query-1,encoding),parameters,encoding); }
public void decodeQueryTo(MultiMap parameters, String encoding) throws UnsupportedEncodingException { if (_query==_fragment) return; if (encoding==null || StringUtil.isUTF8(encoding)) UrlEncoded.decodeUtf8To(_raw,_query+1,_fragment-_query-1,parameters); else UrlEncoded.decodeTo(StringUtil.toString(_raw,_query+1,_fragment-_query-1,encoding),parameters,encoding); }