📄 urlchecker.java
字号:
import java.net.URL;
import java.net.HttpURLConnection;
class URLChecker {
private URL url;
public URLChecker(URL url) {
this.url = url;
}
public boolean check() {
try {
HttpURLConnection.setFollowRedirects(false);
HttpURLConnection conn = (HttpURLConnection)this.url.openConnection();
conn.setRequestMethod("HEAD");
return (conn.getResponseCode() == HttpURLConnection.HTTP_OK);
} catch(Exception e) {
return false;
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -