Class NetUtils
- java.lang.Object
-
- org.apache.logging.log4j.core.util.NetUtils
-
public final class NetUtils extends java.lang.Object
Networking-related convenience methods.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
getLocalHostname()
This method gets the network name of the machine we are running on.static java.net.URI
toURI(java.lang.String path)
Converts a URI string or file path to a URI object.
-
-
-
Method Detail
-
getLocalHostname
public static java.lang.String getLocalHostname()
This method gets the network name of the machine we are running on. Returns "UNKNOWN_LOCALHOST" in the unlikely case where the host name cannot be found.- Returns:
- String the name of the local host
-
toURI
public static java.net.URI toURI(java.lang.String path)
Converts a URI string or file path to a URI object.- Parameters:
path
- the URI string or path- Returns:
- the URI object
-
-