dk.netarkivet.common.utils
Class SystemUtils

java.lang.Object
  extended by dk.netarkivet.common.utils.SystemUtils

public class SystemUtils
extends java.lang.Object

Miscellanous utilities for getting system resources.


Constructor Summary
SystemUtils()
           
 
Method Summary
static java.lang.String getLocalHostName()
          Get the first hostname available for this machine, or "localhost" if none are available.
static java.lang.String getLocalIP()
          Looks up the IP number of the local host.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SystemUtils

public SystemUtils()
Method Detail

getLocalIP

public static java.lang.String getLocalIP()
Looks up the IP number of the local host. Note that Java does not guarantee that the result is IPv4 or IPv6.

Returns:
the found IP; returns "UNKNOWNIP" if it could not be found.

getLocalHostName

public static java.lang.String getLocalHostName()
Get the first hostname available for this machine, or "localhost" if none are available.

Returns:
A hostname, as returned by InetAddress.getLocalHost().getCanonicalHostName()()