- long syncDate = System.currentTimeMillis();
- if (result.isSuccess()) {
- file.setLastSyncDateForProperties(syncDate);
-
- } else {
- // file was successfully uploaded, but the new time stamp and Etag in the server could not be read;
- // just keeping old values :(
- if (!mCurrentUpload.getRemotePath().equals(file.getRemotePath())) {
- // true when the file was automatically renamed to avoid an overwrite
- OCFile newFile = new OCFile(mCurrentUpload.getRemotePath());
- newFile.setCreationTimestamp(file.getCreationTimestamp());
- newFile.setFileLength(file.getFileLength());
- newFile.setMimetype(file.getMimetype());
- newFile.setModificationTimestamp(file.getModificationTimestamp());
- newFile.setLastSyncDateForProperties(file.getLastSyncDateForProperties());
- newFile.setKeepInSync(file.keepInSync());
- // newFile.setEtag(file.getEtag()) // TODO and this is still worse
- file = newFile;
- }
+ file.setLastSyncDateForData(syncDate); // this is right, no matter if the PROPFIND was successful or not
+
+ if (!result.isSuccess() && !mCurrentUpload.getRemotePath().equals(file.getRemotePath())) {
+ // true when the file was automatically renamed to avoid an overwrite ; yes, this is a bit obscure...
+ OCFile newFile = new OCFile(mCurrentUpload.getRemotePath());
+ newFile.setCreationTimestamp(file.getCreationTimestamp());
+ newFile.setFileLength(file.getFileLength());
+ newFile.setMimetype(file.getMimetype());
+ newFile.setModificationTimestamp(file.getModificationTimestamp());
+ newFile.setLastSyncDateForProperties(file.getLastSyncDateForProperties());
+ newFile.setStoragePath(file.getStoragePath());
+ newFile.setKeepInSync(file.keepInSync());
+ // newFile.setEtag(file.getEtag())
+ file = newFile;