class ValidityTools {

	public static boolean isLocalhost ( String host ) {
		// this allows us to be ipv6 compatible (we simply remove the port)
		try {
			InetAddress hostAddress = InetAddress.getByName( host );
			if (hostAddress==null)
				return false;
			for ( InetAddress address : NETWORK_LOCAL_INETADDRESSES )
				if ( address.equals( hostAddress ) ) return true;
			return hostAddress.isLoopbackAddress();
		} catch ( UnknownHostException e ) {
			logger.debug( e.getMessage() );
			return false;
		}
	}

}