public final class Networks extends Object
| Modifier and Type | Method and Description |
|---|---|
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. |
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.UnsupportedEncodingExceptionCopyright © 2015 Cask Data, Inc. Licensed under the Apache License, Version 2.0.