// retrieves url with HEAD. returns content length,
// or -1 in case of error.
static long getURLSizeByHEAD(String url) {
url = absoluteURL(url);
HttpURLConnection conn = null;
InputStream in = null;
try {
conn = (HttpURLConnection) new URL(url).openConnection();
conn.setRequestMethod("HEAD");
conn.setRequestProperty("X-No-Cookies", "1");
in = conn.getInputStream();
return conn.getContentLength();
} catch (IOException e) {
return -1;
} finally {
closeURLConnection(conn, in);
}
}
Began life as a copy of #1001555
download show line numbers debug dex old transpilations
Travelled to 13 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment