*/
public class NetInformation{
public static NetInfoObject getNetInfo() {
SigarProxy sigar = SigarHolder.getInstance();
NetInfoObject netObj = new NetInfoObject();
try {
org.hyperic.sigar.NetInfo netInfo = sigar.getNetInfo();
netObj.setDefaultGateway(netInfo.getDefaultGateway());
netObj.setDomainName(netInfo.getDomainName());
netObj.setHostName(netInfo.getHostName());
netObj.setPrimaryDns(netInfo.getPrimaryDns());
netObj.setSecondaryDns(netInfo.getSecondaryDns());
SigarHolder.clearCache();
} catch (SigarException ex) {
Logger.getLogger(NetInformation.class.getName()).log(Level.SEVERE, null, ex);
}
return netObj;