@@ -0,0 +1,2124 @@
+/*%0A * Copyright (C) 2016 Black Duck Software Inc.%0A * http://www.blackducksoftware.com/%0A * All rights reserved.%0A *%0A * This software is the confidential and proprietary information of%0A * Black Duck Software (%22Confidential Information%22). You shall not%0A * disclose such Confidential Information and shall use it only in%0A * accordance with the terms of the license agreement you entered into%0A * with Black Duck Software.%0A */%0Apackage com.blackducksoftware.integration.util;%0A%0Aimport java.net.InetAddress;%0Aimport java.net.NetworkInterface;%0Aimport java.net.SocketException;%0Aimport java.net.UnknownHostException;%0Aimport java.util.Enumeration;%0A%0Apublic class HostnameHelper %7B%0A%0A    public static String getMyHostname() %7B%0A        String hostName = null;%0A%0A        try %7B%0A            hostName = InetAddress.getLocalHost().getHostName();%0A        %7D catch (UnknownHostException e) %7B%0A            try %7B%0A                // Get the network interfaces for this machine%0A                Enumeration%3CNetworkInterface%3E interfaces = NetworkInterface.getNetworkInterfaces();%0A%0A                while (interfaces.hasMoreElements()) %7B%0A                    NetworkInterface nic = interfaces.nextElement();%0A                    // Get the addresses for this network interface%0A                    Enumeration%3CInetAddress%3E addresses = nic.getInetAddresses();%0A                    // will loop through the addresses until it finds a non loop back address that has a host name%0A                    while (hostName == null && addresses.hasMoreElements()) %7B%0A                        InetAddress address = addresses.nextElement();%0A                        // if the address is not a loopback address then get the host name%0A                        if (!address.isLoopbackAddress()) %7B%0A                            hostName = address.getHostName();%0A                            break;%0A                        %7D%0A                    %7D%0A                    if (hostName != null) %7B%0A                        break;%0A                    %7D%0A                %7D%0A            %7D catch (SocketException se) %7B%0A                // ignore this%0A            %7D%0A        %7D%0A        return hostName;%0A    %7D%0A%7D%0A

Add class to handle getHostname