/** '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 mIgnoreETag;
+
/**
* Creates a new instance of {@link SynchronizeFolderOperation}.
long currentSyncTime,
boolean syncFullAccount,
boolean isShareSupported,
+ boolean ignoreETag,
FileDataStorageManager dataStorageManager,
Account account,
Context context ) {
mContext = context;
mForgottenLocalFiles = new HashMap<String, String>();
mRemoteFolderChanged = false;
+ mIgnoreETag = ignoreETag;
}
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 (!mIgnoreETag) {
+ // 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"));