code: public static boolean isValidIP( String ip ) {
  
  		boolean result = false;
  		try {
  			String[] parts;
  			if( ! Utils.isEmptyOrWhitespaces( ip )
  					&& (parts = ip.split("\\.")).length == 4 ) {
  
  				result = true;
  				for( String s : parts ) {
  					int part = Integer.parseInt( s );
  					if( part < 0 || part > 255 ) {
  						result = false;
  						break;
  					}
  				}
  			}
  
  		} catch( NumberFormatException e ) {
  			result = false;
  		}
  
  		return result;
  	}
docs: Checks the syntax of an IP address (basic check, not exhaustive).
  @param ip The IP to check
  @return true if IP looks like an IP address, false otherwise