/** 'True' means that the remote folder changed from last synchronization and should be fetched */
private boolean mRemoteFolderChanged;
+ /** 'True' means that Etag will be ignored */
+ private boolean mIgnoreTag;
+
/**
* Creates a new instance of {@link SynchronizeFolderOperation}.
long currentSyncTime,
boolean syncFullAccount,
boolean isShareSupported,
+ boolean ignoreTag,
FileDataStorageManager dataStorageManager,
Account account,
Context context ) {
mContext = context;
mForgottenLocalFiles = new HashMap<String, String>();
mRemoteFolderChanged = false;
+ mIgnoreTag = ignoreTag;
}
private RemoteOperationResult checkForChanges(OwnCloudClient client) {
- mRemoteFolderChanged = false;
+ mRemoteFolderChanged = true;
RemoteOperationResult result = null;
String remotePath = null;
result = operation.execute(client);
if (result.isSuccess()){
OCFile remoteFolder = FileStorageUtils.fillOCFile((RemoteFile) result.getData().get(0));
-
- // check if remote and local folder are different
- mRemoteFolderChanged = !(remoteFolder.getEtag().equalsIgnoreCase(mLocalFolder.getEtag()));
-
+
+ if (!mIgnoreTag) {
+ // check if remote and local folder are different
+ mRemoteFolderChanged = !(remoteFolder.getEtag().equalsIgnoreCase(mLocalFolder.getEtag()));
+ }
+
result = new RemoteOperationResult(ResultCode.OK);
Log_OC.i(TAG, "Checked " + mAccount.name + remotePath + " : " + (mRemoteFolderChanged ? "changed" : "not changed"));
mCurrentSyncTime,
true,
mIsShareSupported,
+ true,
getStorageManager(),
getAccount(),
getContext()
Log_OC.e(TAG, "Initializing Fragments in onAccountChanged..");
initFragmentsWithFile();
if (file.isFolder()) {
- startSyncFolderOperation(file);
+ startSyncFolderOperation(file, false);
}
} else {
OCFile root = getStorageManager().getFileByPath(OCFile.ROOT_PATH);
listOfFiles.listDirectory(root);
setFile(listOfFiles.getCurrentFile());
- startSyncFolderOperation(root);
+ startSyncFolderOperation(root, false);
}
cleanSecondFragment();
}
setNavigationListWithFolder(folder);
listOfFiles.listDirectory(folder);
setFile(listOfFiles.getCurrentFile());
- startSyncFolderOperation(folder);
+ startSyncFolderOperation(folder, false);
} else {
Log_OC.e(TAG, "Unexpected null when accessing list fragment");
}
cleanSecondFragment();
// Sync Folder
- startSyncFolderOperation(directory);
+ startSyncFolderOperation(directory, false);
}
@Override
public void onSavedCertificate() {
- startSyncFolderOperation(getCurrentDir());
+ startSyncFolderOperation(getCurrentDir(), false);
}
return null;
}
- public void startSyncFolderOperation(OCFile folder) {
+ public void startSyncFolderOperation(OCFile folder, boolean ignoreTag) {
long currentSyncTime = System.currentTimeMillis();
mSyncInProgress = true;
currentSyncTime,
false,
getFileOperationsHelper().isSharedSupported(),
+ ignoreTag,
getStorageManager(),
getAccount(),
getApplicationContext()
if (folder != null) {
/*mFile = mContainerActivity.getStorageManager().getFileById(mFile.getFileId());
listDirectory(mFile);*/
- startSyncFolderOperation(folder);
+ startSyncFolderOperation(folder, true);
}
}
}
OCFileListFragment listOfFolders = getListOfFilesFragment();
listOfFolders.listDirectory(folder);
- startSyncFolderOperation(folder);
+ startSyncFolderOperation(folder, false);
}
updateNavigationElementsInActionBar();
setFile(directory);
updateNavigationElementsInActionBar();
// Sync Folder
- startSyncFolderOperation(directory);
+ startSyncFolderOperation(directory, false);
}
- public void startSyncFolderOperation(OCFile folder) {
+ public void startSyncFolderOperation(OCFile folder, boolean ignoreTag) {
long currentSyncTime = System.currentTimeMillis();
mSyncInProgress = true;
currentSyncTime,
false,
getFileOperationsHelper().isSharedSupported(),
+ ignoreTag,
getStorageManager(),
getAccount(),
getApplicationContext()
listOfFiles.listDirectory(root);
setFile(listOfFiles.getCurrentFile());
updateNavigationElementsInActionBar();
- startSyncFolderOperation(root);
+ startSyncFolderOperation(root, false);
}
}
if (listOfFiles != null) {
OCFile folder = listOfFiles.getCurrentFile();
if (folder != null) {
- startSyncFolderOperation(folder);
+ startSyncFolderOperation(folder, true);
}
}
}