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

Merge pull request #14 from owncloud/send_file_pr311_with_develop

Added check on the size of the downloded file
This commit is contained in:
David A. Velasco 2014-03-06 13:42:05 +01:00
commit 9040e5087f

View File

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