} else {
client.exhaustResponse(query.getResponseBodyAsStream());
}
- }
-
- // prepare result object
- if (!dirChanged) {
- result = new RemoteOperationResult(ResultCode.OK_NO_CHANGES_ON_DIR);
- mChildren = mStorageManager.getDirectoryContent(mStorageManager.getFileById(mParentId));
-
- } else if (isMultiStatus(status)) {
- if (mConflictsFound > 0 || mFailsInFavouritesFound > 0) {
- result = new RemoteOperationResult(ResultCode.SYNC_CONFLICT); // should be different result, but will do the job
+
+
+ // prepare result object
+ if (!dirChanged) {
+ result = new RemoteOperationResult(ResultCode.OK_NO_CHANGES_ON_DIR);
+ mChildren = mStorageManager.getDirectoryContent(mStorageManager.getFileById(mParentId));
} else {
- result = new RemoteOperationResult(true, status, query.getResponseHeaders());
+ if (mConflictsFound > 0 || mFailsInFavouritesFound > 0) {
+ result = new RemoteOperationResult(ResultCode.SYNC_CONFLICT); // should be different result, but will do the job
+
+ } else {
+ result = new RemoteOperationResult(true, status, query.getResponseHeaders());
+ }
}
+
} else {
result = new RemoteOperationResult(false, status, query.getResponseHeaders());
}
- Log_OC.i(TAG, "Synchronizing " + mAccount.name + ", folder " + mRemotePath + ": " + result.getLogMessage());
} catch (Exception e) {
result = new RemoteOperationResult(e);
if (query != null)
query.releaseConnection(); // let the connection available for other methods
if (result.isSuccess()) {
- Log_OC.i(TAG, "Synchronizing " + mAccount.name + ", folder " + mRemotePath + ": " + result.getLogMessage());
+ Log_OC.i(TAG, "Synchroned " + mAccount.name + ", folder " + mRemotePath + ": " + result.getLogMessage());
} else {
if (result.isException()) {
- Log_OC.e(TAG, "Synchronizing " + mAccount.name + ", folder " + mRemotePath + ": " + result.getLogMessage(), result.getException());
+ Log_OC.e(TAG, "Synchroned " + mAccount.name + ", folder " + mRemotePath + ": " + result.getLogMessage(), result.getException());
} else {
- Log_OC.e(TAG, "Synchronizing " + mAccount.name + ", folder " + mRemotePath + ": " + result.getLogMessage());
+ Log_OC.e(TAG, "Synchroned " + mAccount.name + ", folder " + mRemotePath + ": " + result.getLogMessage());
}
}
if ((synchFolderRemotePath != null && currentDir != null && (currentDir.getRemotePath().equals(synchFolderRemotePath)))
|| fillBlankRoot ) {
- if (!fillBlankRoot)
- currentDir = getStorageManager().getFileByPath(synchFolderRemotePath);
- OCFileListFragment fileListFragment = getListOfFilesFragment();
- if (fileListFragment != null) {
- fileListFragment.listDirectory(currentDir);
-
+ if (synchResult == null || synchResult.isSuccess()) {
+ if (!fillBlankRoot)
+ currentDir = getStorageManager().getFileByPath(synchFolderRemotePath);
+ if (currentDir != null) {
+ OCFileListFragment fileListFragment = getListOfFilesFragment();
+ if (fileListFragment != null) {
+ fileListFragment.listDirectory(currentDir);
+
+ }
+ if (getSecondFragment() == null)
+ setFile(currentDir);
+ }
}
- if (getSecondFragment() == null)
- setFile(currentDir);
}
setSupportProgressBarIndeterminateVisibility(inProgress);