public Map < String , String > getQuery ( ) { String query = uri . getQuery ( ) ; String [ ] pairs = query . split ( "&" ) ; Map < String , String > args = new HashMap <> ( ) ; for ( String pair : pairs ) { int idx = pair . indexOf ( "=" ) ; try { args . put ( URLDecoder . decode ( pair . substring ( 0 , idx ) , "UTF-8" ) , URLDecoder . decode ( pair . substring ( idx + 1 ) , "UTF-8" ) ) ; } catch ( UnsupportedEncodingException e ) { throw new IllegalArgumentException ( e ) ; } } return args ; }
Returns a map of all query arguments .