code: public static boolean isValidIPAddress(String networkAddress) {
  		if (networkAddress != null) {
  			String[] split = networkAddress.split("\\.");
  			if (split.length == 4) {
  				int[] octets = new int[4];
  				for (int i=0; i<4; i++) {
  					try {
  						octets[i] = Integer.parseInt(split[i]);
  					} catch (NumberFormatException e) {
  						return false;
  					}
  					if (octets[i] < 0 || octets[i] > 255) {
  						return false;
  					}
  				}
  				return true;
  			}
  		}
  		return false;
  	}
docs: Verify if a given string is a valid dotted quad notation IP Address
  @param networkAddress The address string
  @return true if its valid, false otherwise