public final class NetUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static String |
getAddress(URL url)
Returns address represented by the specified URL object.
|
static String |
getBaseAddress(String address)
Returns base address for the specified complete address.
|
static String |
getHost(String address)
Returns host for the specified address.
|
static int |
getPort(String address)
Returns port for the specified address or
-1 if it is not set. |
static URI |
getURI(String address)
Returns URI for the specified address.
|
static URL |
getURL(String address)
Returns URL for the specified address.
|
static String |
joinUrlPaths(String part1,
String part2)
Joins two url paths without leaving any unnecessary path separators.
|
static URI |
toURI(URL url)
Returns URI for the specified address.
|
@NotNull public static String getAddress(@NotNull URL url)
url - URL object to process@NotNull public static URL getURL(@NotNull String address)
address - address to process@NotNull public static URI getURI(@NotNull String address)
address - address to process@NotNull public static URI toURI(@NotNull URL url)
url - URL object to process@NotNull public static String getHost(@NotNull String address)
address - address to processpublic static int getPort(@NotNull String address)
-1 if it is not set.address - address to process-1 if it is not set@NotNull public static String getBaseAddress(@NotNull String address)
address - complete address to processCopyright © 2020. All rights reserved.