List of usage examples for java.net URI URI
public URI(String scheme, String ssp, String fragment) throws URISyntaxException
From source file:Main.java
public static void main(String[] args) throws URISyntaxException { URI uri = new URI("http://java2s.com", "8080", "xyz"); System.out.println(uri);//from ww w. jav a 2 s . co m }
From source file:com.google.android.panoramio.GeoCoderTask.java
public GeoResponse geocode(String address) throws IOException, URISyntaxException, JSONException { // prepare a URL to the geocoder String url = GEOCODER_REQUEST_PREFIX_FOR_JSON + "?address=" + URLEncoder.encode(address, "UTF-8") + "&sensor=false"; // prepare an HTTP connection to the geocoder URI uri = new URI("http", url, null); HttpGet get = new HttpGet(uri); HttpClient client = new DefaultHttpClient(); HttpResponse response = client.execute(get); HttpEntity entity = response.getEntity(); String str = Utilities.convertStreamToString(entity.getContent()); JSONObject json = new JSONObject(str); return parse(json); }