org.apache.uima.adapter.vinci.util
Class NetworkUtil

java.lang.Object
  extended by org.apache.uima.adapter.vinci.util.NetworkUtil

public class NetworkUtil
extends java.lang.Object

Network utilities.


Constructor Summary
NetworkUtil()
           
 
Method Summary
static java.net.InetAddress getLocalHostAddress()
          Gets the InetAddress of the localhost.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetworkUtil

public NetworkUtil()
Method Detail

getLocalHostAddress

public static java.net.InetAddress getLocalHostAddress()
                                                throws java.net.UnknownHostException
Gets the InetAddress of the localhost. Attempts to get a non-loopback address (i.e. not 127.0.0.1) if at all possible. This utility is better than InetAddress.getLocalHost() since the latter often fails on Linux.

Returns:
the InetAddress of the localhost. This will be a non-loopback address if one could be found.
Throws:
java.net.UnknownHostException - if the local host address could not be obtained


Copyright © 2012. All Rights Reserved.