Top Fields Constructors Methods
liquibase.util

public Class NetUtil

extends Object
Class Inheritance
Imports
liquibase.Scope, java.net.InetAddress, .NetworkInterface, .SocketException, .UnknownHostException, java.util.Enumeration

Field Summary

Modifier and TypeField and Description
private static String
private static InetAddress
private static final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static InetAddress
getLocalHost()

Smarter way to get localhost than InetAddress.getLocalHost.

public static String

Returns:

Machine's IP address
getLocalHostAddress
()

public static String

Returns:

Machine's host name. This method can be better to call than getting it off getLocalHost() because sometimes the external address returned by that function does not have a useful hostname attached to it. This function will make sure a good value is returned.
getLocalHostName
()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

hostNameback to summary
private static String hostName
localHostback to summary
private static InetAddress localHost
UNKNOWN_HOST_NAMEback to summary
private static final String UNKNOWN_HOST_NAME

Constructor Detail

NetUtilback to summary
private NetUtil()

Method Detail

getLocalHostback to summary
private static InetAddress getLocalHost() throws UnknownHostException, SocketException

Smarter way to get localhost than InetAddress.getLocalHost.

See Also
view bug
getLocalHostAddressback to summary
public static String getLocalHostAddress()
Returns:String

Machine's IP address

getLocalHostNameback to summary
public static String getLocalHostName()
Returns:String

Machine's host name. This method can be better to call than getting it off getLocalHost() because sometimes the external address returned by that function does not have a useful hostname attached to it. This function will make sure a good value is returned.