public SynchronizeFolderOperation(Context context, String remotePath, Account account, long currentSyncTime){
mLocalFolder = new OCFile(remotePath);
mCurrentSyncTime = currentSyncTime;
public SynchronizeFolderOperation(Context context, String remotePath, Account account, long currentSyncTime){
mLocalFolder = new OCFile(remotePath);
mCurrentSyncTime = currentSyncTime;
* @return 'True' when any change was made in the local data, 'false' otherwise
*/
private void synchronizeData(ArrayList<Object> folderAndFiles, OwnCloudClient client) {
* @return 'True' when any change was made in the local data, 'false' otherwise
*/
private void synchronizeData(ArrayList<Object> folderAndFiles, OwnCloudClient client) {
// parse data from remote folder
OCFile remoteFolder = fillOCFile((RemoteFile)folderAndFiles.get(0));
// parse data from remote folder
OCFile remoteFolder = fillOCFile((RemoteFile)folderAndFiles.get(0));
List<SynchronizeFileOperation> filesToSyncContents = new Vector<SynchronizeFileOperation>();
// get current data about local contents of the folder to synchronize
List<SynchronizeFileOperation> filesToSyncContents = new Vector<SynchronizeFileOperation>();
// get current data about local contents of the folder to synchronize
Map<String, OCFile> localFilesMap = new HashMap<String, OCFile>(localFiles.size());
for (OCFile file : localFiles) {
localFilesMap.put(file.getRemotePath(), file);
Map<String, OCFile> localFilesMap = new HashMap<String, OCFile>(localFiles.size());
for (OCFile file : localFiles) {
localFilesMap.put(file.getRemotePath(), file);
// request for the synchronization of file contents AFTER saving current remote properties
startContentSynchronizations(filesToSyncContents, client);
// request for the synchronization of file contents AFTER saving current remote properties
startContentSynchronizations(filesToSyncContents, client);
) {
RemoteOperationResult contentsResult = null;
for (SynchronizeFileOperation op: filesToSyncContents) {
) {
RemoteOperationResult contentsResult = null;
for (SynchronizeFileOperation op: filesToSyncContents) {