public class URLUtil extends Object
| Constructor and Description |
|---|
URLUtil() |
| Modifier and Type | Method and Description |
|---|---|
static URLConnection |
createUnCertifiedConnection(URL url,
Proxy proxy)
Creates connection to the specified url.
|
static Map<String,String> |
getQueryParams(String uri,
String encoding)
returns Query Parameters in specified uri as
Map. |
static void |
main(String[] args) |
static URI |
relativize(String base,
String child) |
static URI |
resolve(String base,
String child) |
static String |
suggestFile(URI uri,
String extension) |
static String |
suggestPrefix(Properties suggested,
String uri) |
static String |
toSystemID(URL url) |
static URI |
toURI(String str)
Constructs
URI from given string. |
static URI |
toURI(URL url)
Constructs
URI from given URL. |
static URL |
toURL(String systemID) |
public static URI toURI(String str)
URI from given string.
The URISyntaxException is rethrown as IllegalArgumentExceptionpublic static URI toURI(URL url)
URI from given URL.
The URISyntaxException is rethrown as IllegalArgumentExceptionpublic static Map<String,String> getQueryParams(String uri, String encoding) throws URISyntaxException, UnsupportedEncodingException
Map.
key will be param name and value wil be param value.uri - The string to be parsed into a URIencoding - if null, UTF-8 will be usedURISyntaxException - in case of invalid uriUnsupportedEncodingException - if named character encoding is not supportedpublic static String suggestPrefix(Properties suggested, String uri)
public static URLConnection createUnCertifiedConnection(URL url, Proxy proxy) throws IOException
https the connection
created doesn't validate any certificates.url - url to which connection has to be createdproxy - proxy to be used. can be nullURLConnection. the connection is not yet connectedIOException - if an I/O exception occursCopyright © 2021. All rights reserved.