public static Multimap < String , String > getParameters ( final String rawQuery ) { Multimap < String , String > result = HashMultimap . create ( ) ; if ( rawQuery == null ) { return result ; } StringTokenizer tokens = new StringTokenizer ( rawQuery , "&" ) ; while ( tokens . hasMoreTokens ( ) ) { String pair = tokens . nextToken ( ) ; int pos = pair . indexOf ( ' ' ) ; String key ; String value ; if ( pos == - 1 ) { key = pair ; value = "" ; } else { try { key = URLDecoder . decode ( pair . substring ( 0 , pos ) , "UTF-8" ) ; value = URLDecoder . decode ( pair . substring ( pos + 1 ) , "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { throw ExceptionUtils . getRuntimeException ( e ) ; } } result . put ( key , value ) ; } return result ; }
Parse the URI and get all the parameters in map form . Query name - &gt ; List of Query values .