use HEAD request when just checking the file size

This code will be changed again when implementing the client-side etag
check #562

closes #777
This commit is contained in:
Hans-Christoph Steiner 2016-11-10 13:30:06 +01:00
parent 096b7132c4
commit ab1e869ebe

View File

@ -83,6 +83,7 @@ public class HttpDownloader extends Downloader {
// get the file size from the server
HttpURLConnection tmpConn = getConnection();
tmpConn.setRequestMethod("HEAD");
int contentLength = -1;
if (tmpConn.getResponseCode() == 200) {
contentLength = tmpConn.getContentLength();