Эх сурвалжийг харах

Added construction of SynchronizeFolderOperation to OperationService

David A. Velasco 10 жил өмнө
parent
commit
56eaed4529

+ 4 - 5
src/com/owncloud/android/operations/SyncFolderOperation.java → src/com/owncloud/android/operations/SynchronizeFolderOperation.java

@@ -26,7 +26,6 @@ import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.files.services.FileDownloader;
 import com.owncloud.android.lib.common.OwnCloudClient;
-import com.owncloud.android.lib.common.operations.RemoteOperation;
 import com.owncloud.android.lib.common.operations.RemoteOperationResult;
 import com.owncloud.android.lib.common.operations.RemoteOperationResult.ResultCode;
 import com.owncloud.android.lib.common.utils.Log_OC;
@@ -64,9 +63,9 @@ import java.util.Vector;
  * 
  *  @author David A. Velasco
  */
-public class SyncFolderOperation extends SyncOperation {
+public class SynchronizeFolderOperation extends SyncOperation {
 
-    private static final String TAG = SyncFolderOperation.class.getSimpleName();
+    private static final String TAG = SynchronizeFolderOperation.class.getSimpleName();
 
     /** Time stamp for the synchronization process in progress */
     private long mCurrentSyncTime;
@@ -103,14 +102,14 @@ public class SyncFolderOperation extends SyncOperation {
 
 
     /**
-     * Creates a new instance of {@link SyncFolderOperation}.
+     * Creates a new instance of {@link SynchronizeFolderOperation}.
      *
      * @param   context                 Application context.
      * @param   remotePath              Path to synchronize.
      * @param   account                 ownCloud account where the folder is located.
      * @param   currentSyncTime         Time stamp for the synchronization process in progress.
      */
-    public SyncFolderOperation(Context context, String remotePath, Account account, long currentSyncTime){
+    public SynchronizeFolderOperation(Context context, String remotePath, Account account, long currentSyncTime){
         mLocalFolder = new OCFile(remotePath);
         mCurrentSyncTime = currentSyncTime;
         mStorageManager = getStorageManager();

+ 5 - 3
src/com/owncloud/android/services/OperationsService.java

@@ -48,6 +48,7 @@ import com.owncloud.android.operations.OAuth2GetAccessToken;
 import com.owncloud.android.operations.RemoveFileOperation;
 import com.owncloud.android.operations.RenameFileOperation;
 import com.owncloud.android.operations.SynchronizeFileOperation;
+import com.owncloud.android.operations.SynchronizeFolderOperation;
 import com.owncloud.android.operations.UnshareLinkOperation;
 
 import android.accounts.Account;
@@ -456,11 +457,12 @@ public class OperationsService extends Service {
                     // Sync file
                     String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH);
                     boolean syncFileContents = operationIntent.getBooleanExtra(EXTRA_SYNC_FILE_CONTENTS, true);
-                    /* TODO - merge code for new SynchronizeFolderOperation
                     operation = new SynchronizeFolderOperation(
-                            
+                            this,                       // TODO remove this dependency from construction time 
+                            remotePath,
+                            account, 
+                            System.currentTimeMillis()  // TODO remove this dependency from construction time
                     );
-                    */
                     
                 } else if (action.equals(ACTION_MOVE_FILE)) {
                     // Move file/folder