Examples of NetBIOSResolver


Examples of net.azib.ipscan.util.NetBIOSResolver

    }
  }

  private String resolveWithNetBIOS(ScanningSubject subject) {
    try {
      NetBIOSResolver resolver = new NetBIOSResolver(subject.getAdaptedPortTimeout());
      String[] names = resolver.resolve(subject.getAddress());
      resolver.close();
      return names == null ? null : names[0];
    }
    catch (SocketTimeoutException e) {
      return null;
    }
View Full Code Here

Examples of net.azib.ipscan.util.NetBIOSResolver

  public String getId() {
    return "fetcher.netbios";
  }

  public Object scan(ScanningSubject subject) {
    NetBIOSResolver netbios = null;
    try {
      netbios = new NetBIOSResolver(subject.getAdaptedPortTimeout());
      String[] names = netbios.resolve(subject.getAddress());
      if (names == null) return null;

      String computerName = names[0];
      String userName = names[1];
      String groupName = names[2];
      String macAddress = names[3];

      return (groupName != null ? groupName + "\\" : "") +
          (userName != null ? userName + "@" : "") +
          computerName + " [" + macAddress + "]";
    }
    catch (SocketTimeoutException e) {
      // this is not a derivative of SocketException
      return null;
    }
    catch (SocketException e) {
      // this includes PortUnreachableException
      return null;
    }
    catch (Exception e) {
      // bugs?
      LOG.log(WARNING, null, e);
      return null;
    }
    finally {
      if (netbios != null) netbios.close();
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.