- // loop to update every child
- OCFile remoteFile = null, localFile = null;
- for (int i = 1; i < dataInServer.getResponses().length; ++i) {
- /// new OCFile instance with the data from the server
- we = new WebdavEntry(dataInServer.getResponses()[i], client.getBaseUri().getPath());
- remoteFile = fillOCFile(we);
- remoteFile.setParentId(mLocalFolder.getFileId());
-
- /// retrieve local data for the read file
- localFile = mStorageManager.getFileByPath(remoteFile.getRemotePath());
-
- /// add to the remoteFile (the new one) data about LOCAL STATE (not existing in the server side)
- remoteFile.setLastSyncDateForProperties(mCurrentSyncTime);
- if (localFile != null) {
- // properties of local state are kept unmodified
- remoteFile.setKeepInSync(localFile.keepInSync());
- remoteFile.setLastSyncDateForData(localFile.getLastSyncDateForData());
- remoteFile.setModificationTimestampAtLastSyncForData(localFile.getModificationTimestampAtLastSyncForData());
- remoteFile.setStoragePath(localFile.getStoragePath());
- remoteFile.setEtag(localFile.getEtag()); // eTag will not be updated unless contents are synchronized (Synchronize[File|Folder]Operation with remoteFile as parameter)
- } else {
- remoteFile.setEtag(""); // remote eTag will not be updated unless contents are synchronized (Synchronize[File|Folder]Operation with remoteFile as parameter)
- }
-
- /// check and fix, if need, local storage path
- checkAndFixForeignStoragePath(remoteFile); // fixing old policy - now local files must be copied into the ownCloud local folder
- searchForLocalFileInDefaultPath(remoteFile); // legacy
-
- /// prepare content synchronization for kept-in-sync files
- if (remoteFile.keepInSync()) {
- SynchronizeFileOperation operation = new SynchronizeFileOperation( localFile,
- remoteFile,
- mStorageManager,
- mAccount,
- true,
- false,
- mContext
- );
- filesToSyncContents.add(operation);
+ /// add to the remoteFile (the new one) data about LOCAL STATE (not existing in the server side)
+ remoteFile.setLastSyncDateForProperties(mCurrentSyncTime);
+ if (localFile != null) {
+ // some properties of local state are kept unmodified
+ remoteFile.setFileId(localFile.getFileId());
+ remoteFile.setKeepInSync(localFile.keepInSync());
+ remoteFile.setLastSyncDateForData(localFile.getLastSyncDateForData());
+ remoteFile.setModificationTimestampAtLastSyncForData(localFile.getModificationTimestampAtLastSyncForData());
+ remoteFile.setStoragePath(localFile.getStoragePath());
+ remoteFile.setEtag(localFile.getEtag()); // eTag will not be updated unless contents are synchronized (Synchronize[File|Folder]Operation with remoteFile as parameter)
+ if (remoteFile.isFolder()) {
+ remoteFile.setFileLength(localFile.getFileLength()); // TODO move operations about size of folders to FileContentProvider