Package oshi.software.common
Class AbstractNetworkParams
- java.lang.Object
-
- oshi.software.common.AbstractNetworkParams
-
- All Implemented Interfaces:
java.io.Serializable
,NetworkParams
- Direct Known Subclasses:
FreeBsdNetworkParams
,LinuxNetworkParams
,MacNetworkParams
,SolarisNetworkParams
,WindowsNetworkParams
public abstract class AbstractNetworkParams extends java.lang.Object implements NetworkParams
Common NetworkParams implementation.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description AbstractNetworkParams()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]
getDnsServers()
java.lang.String
getDomainName()
java.lang.String
getHostName()
protected static java.lang.String
searchGateway(java.util.List<java.lang.String> lines)
Convenience method to parse the output of the `route` command.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface oshi.software.os.NetworkParams
getIpv4DefaultGateway, getIpv6DefaultGateway
-
-
-
-
Method Detail
-
getDomainName
public java.lang.String getDomainName()
- Specified by:
getDomainName
in interfaceNetworkParams
- Returns:
- Gets domain name
-
getHostName
public java.lang.String getHostName()
- Specified by:
getHostName
in interfaceNetworkParams
- Returns:
- Gets host name
-
getDnsServers
public java.lang.String[] getDnsServers()
- Specified by:
getDnsServers
in interfaceNetworkParams
- Returns:
- Gets DNS servers
-
searchGateway
protected static java.lang.String searchGateway(java.util.List<java.lang.String> lines)
Convenience method to parse the output of the `route` command. While the command arguments vary between OS's the output is consistently parsable.- Parameters:
lines
- output of OS-specific route command- Returns:
- default gateway
-
-