Modifier and Type | Method and Description |
---|---|
static String |
getLocalHostname()
This method gets the network name of the machine we are running on.
|
static List<String> |
getLocalIps()
Returns all the local host names and ip addresses.
|
static byte[] |
getMacAddress()
Returns the local network interface's MAC address if possible.
|
static String |
getMacAddressString()
Returns the mac address, if it is available, as a string with each byte separated by a ":" character.
|
static URI |
toURI(String path)
Converts a URI string or file path to a URI object.
|
public static String getLocalHostname()
public static List<String> getLocalIps()
public static byte[] getMacAddress()
NetworkInterface
that is both up and not a loopback interface.null
if no MAC address could be determined.public static String getMacAddressString()
Copyright © 1999-2021 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.