|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectco.cask.common.Networks
public final class Networks
Utility class to provide methods for common network related operations.
| Method Summary | |
|---|---|
static int |
getRandomPort()
Find a random free port in localhost for binding. |
static String |
normalizeWebappDiscoveryName(String name)
Normalizes the name by doing the following: Remove trailing slashes. Remove :80 from end of the host part if any. Replace '.', ':', '/' and '-' with '_'. URL encode the name. |
static InetAddress |
resolve(String hostname,
InetAddress onErrorAddress)
Resolves the given hostname into InetAddress. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static InetAddress resolve(String hostname,
InetAddress onErrorAddress)
InetAddress.
hostname - The hostname in String. If null, return localhost.onErrorAddress - InetAddress to return if the given hostname cannot be resolved.
InetAddress of the resolved hostname.public static int getRandomPort()
public static String normalizeWebappDiscoveryName(String name)
throws UnsupportedEncodingException
name - discovery name that needs to be normalized.
UnsupportedEncodingException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||