JAVA 中 验证IP的有效性
来源:互联网 发布:域名流量劫持 编辑:程序博客网 时间:2024/04/27 04:25
public void pingIP(String ipKey, String ipValue) throws RSInstallerException{
Boolean bool=false;
try
{
bool = InetAddress.getByName(ipValue.trim()).isReachable(10000);
}
catch (UnknownHostException e)
{
throw new RSInstallerException(e.toString().split(":")[0],e.getMessage());
}
catch (IOException e)
{
throw new RSInstallerException(e.toString().split(":")[0], e.getMessage());
}
/*
* If the IP can't ping record the detail info to log file
*/
if (!bool)
{
String ipPingError = "The " + ipKey + " = " + ipValue + " ping failed .Maybe is the physics connection is illogical.";
LOGGER.warn(ipPingError);
warnInfo.append(ipPingError + "#");
}
}
Boolean bool=false;
try
{
bool = InetAddress.getByName(ipValue.trim()).isReachable(10000);
}
catch (UnknownHostException e)
{
throw new RSInstallerException(e.toString().split(":")[0],e.getMessage());
}
catch (IOException e)
{
throw new RSInstallerException(e.toString().split(":")[0], e.getMessage());
}
/*
* If the IP can't ping record the detail info to log file
*/
if (!bool)
{
String ipPingError = "The " + ipKey + " = " + ipValue + " ping failed .Maybe is the physics connection is illogical.";
LOGGER.warn(ipPingError);
warnInfo.append(ipPingError + "#");
}
}
- JAVA 中 验证IP的有效性
- JAVA验证IP地址的有效性
- 验证IP地址的有效性
- java中身份证有效性验证算法
- java正则表达式验证IP,日期和邮箱格式有效性
- form表单中属性的有效性验证
- java对email的真实、有效性验证
- java日期有效性验证
- JAVA 身份证号码有效性验证
- 用ping验证大量IP地址的有效性
- 数字证书的有效性验证
- 数字证书的有效性验证
- 验证身份证的有效性
- 验证邮箱的有效性
- java实现身份证有效性验证
- 验证西刺代理ip有效性
- awk中一个验证passwd文件有效性的例子
- Java实现通过smtp服务器验证邮箱的真实有效性
- Love is gone
- 面向接口编程的作用
- makefile进入子文件夹执行make
- javascript 浏览器兼容性心得
- 网络拓扑结构5-9-1读取数据库并训练预测
- JAVA 中 验证IP的有效性
- Zookeeper全解析——Client端
- 红黑树
- 网络socket编程指南之一
- 软件质量概述
- 弹出窗口总结
- 摄像机防穿帮virtools思路实现
- CFileDialog中的控件子类化问题
- Scrum Update: 2011