X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/9b5506f81e61906c094f210b19d66dbbb99d505f..95bebe9382cd34e3811c1ef00d9e3b9018163328:/src/com/owncloud/android/files/services/FileDownloader.java diff --git a/src/com/owncloud/android/files/services/FileDownloader.java b/src/com/owncloud/android/files/services/FileDownloader.java index 58f38ed0..3057e5a0 100644 --- a/src/com/owncloud/android/files/services/FileDownloader.java +++ b/src/com/owncloud/android/files/services/FileDownloader.java @@ -438,13 +438,8 @@ public class FileDownloader extends Service saveDownloadedFile(); } - } catch (AccountsException e) { - Log_OC.e(TAG, "Error while trying to get authorization for " - + mCurrentAccount.name, e); - downloadResult = new RemoteOperationResult(e); - } catch (IOException e) { - Log_OC.e(TAG, "Error while trying to get authorization for " - + mCurrentAccount.name, e); + } catch (Exception e) { + Log_OC.e(TAG, "Error downloading", e); downloadResult = new RemoteOperationResult(e); } finally { @@ -471,6 +466,8 @@ public class FileDownloader extends Service /** * Updates the OC File after a successful download. + * + * TODO move to DownloadFileOperation */ private void saveDownloadedFile() { OCFile file = mStorageManager.getFileById(mCurrentDownload.getFile().getFileId()); @@ -480,13 +477,14 @@ public class FileDownloader extends Service file.setNeedsUpdateThumbnail(true); file.setModificationTimestamp(mCurrentDownload.getModificationTimestamp()); file.setModificationTimestampAtLastSyncForData(mCurrentDownload.getModificationTimestamp()); - // file.setEtag(mCurrentDownload.getEtag()); // TODO Etag, where available + file.setEtag(mCurrentDownload.getEtag()); file.setMimetype(mCurrentDownload.getMimeType()); file.setStoragePath(mCurrentDownload.getSavePath()); file.setFileLength((new File(mCurrentDownload.getSavePath()).length())); file.setRemoteId(mCurrentDownload.getFile().getRemoteId()); mStorageManager.saveFile(file); mStorageManager.triggerMediaScan(file.getStoragePath()); + mStorageManager.saveConflict(file, false); } /**