All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jvnet.jax_ws_commons.json.QueryStringParser Maven / Gradle / Ivy

package org.jvnet.jax_ws_commons.json;

import com.sun.xml.ws.transport.http.WSHTTPConnection;

import java.util.HashMap;

/**
 * Quick-n-dirty query string parser.
 *
 * @author Kohsuke Kawaguchi
 */
final class QueryStringParser extends HashMap {
    QueryStringParser(WSHTTPConnection con) {
        this(con.getQueryString());
    }
    QueryStringParser(String queryString) {
        if(queryString==null)   return;

        for( String token : queryString.split("&") ) {
            int idx = token.indexOf('=');
            if(idx<0)
                put(token,"");
            else
                put(token.substring(0,idx),token.substring(idx+1));
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy