code: public static String getIP(final InetAddress inetAddress)
  	{
  		String ip = "";
  		ip = inetAddress.getHostAddress();
  		if (ip.equals(""))
  		{
  			final byte[] ipAddressInBytes = inetAddress.getAddress();
  			for (int i = 0; i < ipAddressInBytes.length; i++)
  			{
  				if (i > 0)
  				{
  					ip += ".";
  				}
  				ip += ipAddressInBytes[i] & 0xFF;
  			}
  		}
  		return ip;
  	}
docs: Gets the ip address from the given InetAddress object as a String.
  
  @param inetAddress
  the inet address
  @return Returns the ip address from the given InetAddress as a String.