String url to uri java code example Example: url string from url java URL url = new URL("www.google.com"); string urlString = url.getPath();