/**
* 检查URL是否ping通
*
* @Title: existsIsUrl
* @Description:
* @return boolean
* @throws
* @param URLName
* @return 2013-11-1
*/
private boolean existsIsTrue(String s) {
boolean temp = false;
URL url;
try {
url = new URL(s);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
int state = con.getResponseCode();
if (state == 200) {
temp = true;
} else {
temp = false;
}
} catch (Exception e1) {
url = null;
return temp;
}
return temp;
}
检查URL是否ping通
最新推荐文章于 2022-10-10 22:07:22 发布