(String host)
| 636 | } |
| 637 | |
| 638 | private boolean isValidIPv4Address(String host) { |
| 639 | int index; |
| 640 | int index2; |
| 641 | try { |
| 642 | int num; |
| 643 | index = host.indexOf('.'); |
| 644 | num = Integer.parseInt(host.substring(0, index)); |
| 645 | if (num < 0 || num > 255) { |
| 646 | return false; |
| 647 | } |
| 648 | index2 = host.indexOf('.', index + 1); |
| 649 | num = Integer.parseInt(host.substring(index + 1, index2)); |
| 650 | if (num < 0 || num > 255) { |
| 651 | return false; |
| 652 | } |
| 653 | index = host.indexOf('.', index2 + 1); |
| 654 | num = Integer.parseInt(host.substring(index2 + 1, index)); |
| 655 | if (num < 0 || num > 255) { |
| 656 | return false; |
| 657 | } |
| 658 | num = Integer.parseInt(host.substring(index + 1)); |
| 659 | if (num < 0 || num > 255) { |
| 660 | return false; |
| 661 | } |
| 662 | } catch (Exception e) { |
| 663 | return false; |
| 664 | } |
| 665 | return true; |
| 666 | } |
| 667 | |
| 668 | private boolean isValidIP6Address(String ipAddress) { |
| 669 | int length = ipAddress.length(); |
no test coverage detected