public static HashMap < String , String > getParameters ( String query ) { HashMap < String , String > params = new HashMap < String , String > ( ) ; if ( query == null || query . length ( ) == 0 ) { return params ; } String [ ] splitQuery = query . split ( "&" ) ; for ( String splitItem : splitQuery ) { String [ ] items = splitItem . split ( "=" ) ; if ( items . length == 1 ) { params . put ( items [ 0 ] , "" ) ; } else { params . put ( items [ 0 ] , items [ 1 ] ) ; } } return params ; }
Obtain parameters from query