Changeset 343:7f06d669913d for kraken-linux-api/src/main/java/org/krakenapps/linux/api/NetworkInterface.java
- Timestamp:
- 09/18/11 13:55:15 (8 months ago)
- Branch:
- default
- Convert:
- svn:7c3792e6-d75b-4784-96a6-b298f655ee64/trunk@2777
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kraken-linux-api/src/main/java/org/krakenapps/linux/api/NetworkInterface.java
r2 r343 1 /* 2 * Copyright 2011 Future Systems 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 1 16 package org.krakenapps.linux.api; 2 17 … … 107 122 } 108 123 109 public static List<NetworkInterface> getNetworkInterfaces() {124 public static List<NetworkInterface> getNetworkInterfaces() throws IOException { 110 125 List<NetworkInterface> ifaces = new ArrayList<NetworkInterface>(); 111 126 java.lang.Process p = null; … … 122 137 ifaces.add(iface); 123 138 } 124 } catch (IOException e) {125 e.printStackTrace();126 139 } finally { 127 140 if (p != null) 128 141 p.destroy(); 129 try { 130 if (br != null) 131 br.close(); 132 } catch (IOException e) { 133 e.printStackTrace(); 134 } 142 if (br != null) 143 br.close(); 135 144 } 136 145 … … 258 267 @Override 259 268 public String toString() { 260 return "RxPacket [packets=" + packets + ", errors=" + errors + ", dropped=" + dropped + ", overruns=" 261 + overruns +", frame=" + frame + "]";269 return "RxPacket [packets=" + packets + ", errors=" + errors + ", dropped=" + dropped + ", overruns=" + overruns 270 + ", frame=" + frame + "]"; 262 271 } 263 272 } … … 332 341 @Override 333 342 public String toString() { 334 return "TxPacket [packets=" + packets + ", errors=" + errors + ", dropped=" + dropped + ", overruns=" 335 + overruns +", carrier=" + carrier + ", collisions=" + collisions + ", queuelen=" + queuelen + "]";343 return "TxPacket [packets=" + packets + ", errors=" + errors + ", dropped=" + dropped + ", overruns=" + overruns 344 + ", carrier=" + carrier + ", collisions=" + collisions + ", queuelen=" + queuelen + "]"; 336 345 } 337 346 } … … 339 348 @Override 340 349 public String toString() { 341 return "NetworkInterface [name=" + name + ", linkEncap=" + linkEncap + ", hwaddr=" + hwaddr + ", inet=" + inet 342 + ", ptp=" + ptp + ", mask=" + mask + ", inet6=" + inet6 + ", cidr=" + cidr + ", scope=" + scope343 + ", options=" + options + ", mtu=" + mtu + ", metric=" + metric + ", rxPacket=" + rxPacket344 + ", txPacket=" + txPacket + ", rxBytes=" + rxBytes + ", txBytes=" + txBytes + ", interrupt="345 + interrupt + ", baseAddress=" + baseAddress + ", memory=" +memory + "]";350 return "NetworkInterface [name=" + name + ", linkEncap=" + linkEncap + ", hwaddr=" + hwaddr + ", inet=" + inet + ", ptp=" 351 + ptp + ", mask=" + mask + ", inet6=" + inet6 + ", cidr=" + cidr + ", scope=" + scope + ", options=" + options 352 + ", mtu=" + mtu + ", metric=" + metric + ", rxPacket=" + rxPacket + ", txPacket=" + txPacket + ", rxBytes=" 353 + rxBytes + ", txBytes=" + txBytes + ", interrupt=" + interrupt + ", baseAddress=" + baseAddress + ", memory=" 354 + memory + "]"; 346 355 } 347 356 }
Note: See TracChangeset
for help on using the changeset viewer.
