hi i am trying to get request token in from google apis.for getting request token i have to sort the parameter string by lexicographical byte value ordering in java code segment for the string
String datastring=URLEncoder.encode("oauth_version", "UTF-8")+"="+URLEncoder.encode("1.0", "UTF-8");
datastring+="&"+URLEncoder.encode("oauth_nonce", "UTF-8")+"="+URLEncoder.encode(System.currentTimeMillis()+"","UTF-8");
datastring+="&"+URLEncoder.encode("oauth_timestamp", "UTF-8")+"="+URLEncoder.encode(System.currentTimeMillis()/1000+"","UTF-8");
datastring+="&"+URLEncoder.encode("oauth_consumer_key","UTF-8")+"="+URLEncoder.encode("iriteshmehandiratta.appspot.com","UTF-8");
datastring+="&"+URLEncoder.encode("oauth_signature_method","UTF-8")+"="+URLEncoder.encode("RSA-SHA1", "UTF-8");
datastring+="&"+URLEncoder.encode("oauth_signature", "UTF-8")+"="+URLEncoder.encode(myrsakey, "UTF-8");
datastring+="&"+URLEncoder.encode("oauth_callback","UTF-8")+"="+URLEncoder.encode("https://www.iriteshmehandiratta.appspot.com/authsub","UTF-8");
datastring+="&"+URLEncoder.encode("scope","UTF-8")+"="+URLEncoder.encode("http://www.google.com/calendar/feeds","UTF-8");
i encoded parameters of query string now i have to lexicographically sort datastring for sending a post request to URL https://www.google.com/accounts/OAuthGetRequestToken can any one please help how to sort this string lexicographically in java.