com.compoze.collab.util
Class NetUtility

java.lang.Object
  extended by com.compoze.collab.util.NetUtility

public class NetUtility
extends Object

This class contains helper methods for networking related tasks.


Method Summary
static byte[] getLocalAddress()
          Gets the local address on the machine (updated only once every minute as this operation takes a minimum of 4 ms on Windows).
static InetAddress getLocalHost()
          Gets the local address on the machine (updated only once every minute as this operation takes a minimum of 4 ms on Windows).
static String getLocalHostname()
          Gets the hostname of the machine (updated only once every minute as this operation takes a minimum of 4 ms on Windows).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getLocalHostname

public static String getLocalHostname()
Gets the hostname of the machine (updated only once every minute as this operation takes a minimum of 4 ms on Windows).

Returns
the hostname of the machine, or localhost if it could not be determined

getLocalAddress

public static byte[] getLocalAddress()
Gets the local address on the machine (updated only once every minute as this operation takes a minimum of 4 ms on Windows).

Returns
the local address, or 127.0.0.1 if it could not be determined

getLocalHost

public static InetAddress getLocalHost()
                                throws UnknownHostException
Gets the local address on the machine (updated only once every minute as this operation takes a minimum of 4 ms on Windows).

Returns
the local address
Throws
UnknownHostException - if the local address could not be determined


Copyright © 2006 BEA Systems, Inc. All Rights Reserved