Package host.anzo.commons.utils
Class NetworkUtils
java.lang.Object
host.anzo.commons.utils.NetworkUtils
- Since:
- 03.03.12 16:01
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic @Nullable Stringstatic booleanisLocalAddress(@NotNull String address) static booleanisLocalAddress(@NotNull InetAddress address) static booleanisPortFree(int port) static boolean
-
Constructor Details
-
NetworkUtils
public NetworkUtils()
-
-
Method Details
-
getExternalIP
- Returns:
- external IP address,
nullif can't detect external IP
-
isLocalAddress
- Parameters:
address- address for check- Returns:
trueif specified address is local,falseotherwise
-
isLocalAddress
- Parameters:
address- address for check- Returns:
trueif specified address is local,falseotherwise
-
isValidIp
- Parameters:
ip- ip to check- Returns:
trueif specified IP is valid,falseotherwise
-
isPortFree
public static boolean isPortFree(int port) - Parameters:
port- port to check- Returns:
trueif port is free,falseotherwise
-