2 changed files with 1 additions and 31 deletions
@ -1,30 +0,0 @@ |
|||
package cn.chjyj.szwh.utils; |
|||
|
|||
import java.net.HttpURLConnection; |
|||
import java.net.URL; |
|||
|
|||
/** |
|||
* 描述: |
|||
* |
|||
* @author xu.jin.feng |
|||
* @create 2022/6/16 11:44 |
|||
* @company 深圳亿起融网络科技有限公司 |
|||
*/ |
|||
public class NetUtil { |
|||
|
|||
/** |
|||
* 判断网络图片是否存在 |
|||
* imgUrl 图片地址链接 |
|||
*/ |
|||
public static Boolean checkUrlValidity(String imgUrl) { |
|||
int RESPONSE_CODE = 0; |
|||
try { |
|||
URL url = new URL(imgUrl); |
|||
HttpURLConnection connection = (HttpURLConnection) url.openConnection(); |
|||
RESPONSE_CODE = connection.getResponseCode(); |
|||
} catch (Exception e) { |
|||
} |
|||
return RESPONSE_CODE == HttpURLConnection.HTTP_OK; |
|||
} |
|||
|
|||
} |
|||
Loading…
Reference in new issue