public static InetAddress parse(final String ip)
	{
		if (ip == null || ip.isEmpty())
			throw new IllegalArgumentException("A null or empty string is not a valid IP address!");

		try
		{
			return InetAddress.getByName(ip);
		}
		catch (Throwable t)
		{
			throw new IllegalArgumentException("Not a valid IP address: " + ip, t);
		}
	}
public static InetAddress parse ( final String ip ) { if ( ip == null || ip . isEmpty ( ) ) throw new IllegalArgumentException ( "A null or empty string is not a valid IP address!" ) ; try { return InetAddress . getByName ( ip ) ; } catch ( Throwable t ) { throw new IllegalArgumentException ( "Not a valid IP address: " + ip , t ) ; } }
Parses an IP address, throwing an {@link IllegalArgumentException} (rather than an {@link UnknownHostException}) if it is
invalid

@param ip
the IP - must not be null or an empty string. should be a valid IP address (eg. 1.2.3.4)

@return an InetAddress