1
0
mirror of https://github.com/owncloud/android-library.git synced 2025-06-07 16:06:08 +00:00

OC-3097: (fix bug) When the connection is lost during a download, app thinks that the download is finished

This commit is contained in:
masensio 2014-02-28 13:53:56 +01:00
parent cd4414a7bd
commit fb267a0564

View File

@ -131,12 +131,16 @@ public class DownloadRemoteFileOperation extends RemoteOperation {
}
}
}
if (transferred == totalToTransfer) { // Check if the file is completed
savedFile = true;
Header modificationTime = mGet.getResponseHeader("Last-Modified");
if (modificationTime != null) {
Date d = WebdavUtils.parseResponseDate((String) modificationTime.getValue());
mModificationTimestamp = (d != null) ? d.getTime() : 0;
}
} else {
client.exhaustResponse(mGet.getResponseBodyAsStream());
}
} else {
client.exhaustResponse(mGet.getResponseBodyAsStream());