public static boolean isValidIp(String ip) {
		if (ip == null) return false;

		String[] ipSplitted = ip.split("\\.");

		if (ipSplitted.length != 4) return false;

		for (int i = 0; i < ipSplitted.length; i++) {
			if (ipSplitted[i].length() > 3) return false;
			try {
				int ipPart = Integer.parseInt(ipSplitted[i]);
				if (ipPart < 0 || ipPart > 255) return false;
			} catch (NumberFormatException e) {
				return false;
			}
		}

		return true;
	}