Add author's line in license
[pub/Android/ownCloud.git] / src / com / owncloud / android / operations / MoveFileOperation.java
index a4838ec..d354454 100644 (file)
@@ -1,4 +1,6 @@
 /* ownCloud Android client application
+ *
+ *   @author David A. Velasco
  *   Copyright (C) 2012-2014 ownCloud Inc.
  *
  *   This program is free software: you can redistribute it and/or modify
@@ -29,8 +31,6 @@ import android.accounts.Account;
 
 /**
  * Operation mmoving an {@link OCFile} to a different folder.
- * 
- * @author David A. Velasco
  */
 public class MoveFileOperation extends SyncOperation {
     
@@ -80,6 +80,9 @@ public class MoveFileOperation extends SyncOperation {
         
         /// 2. remote move
         String targetPath = mTargetParentPath + mFile.getFileName();
+        if (mFile.isFolder()) {
+            targetPath += OCFile.PATH_SEPARATOR;
+        }
         MoveRemoteFileOperation operation = new MoveRemoteFileOperation(
                 mSrcPath, 
                 targetPath, 
@@ -89,8 +92,7 @@ public class MoveFileOperation extends SyncOperation {
         
         /// 3. local move
         if (result.isSuccess()) {
-            // TODO work in progress
-            //getStorageManager().moveLocalFile(mFile, targetPath);
+            getStorageManager().moveLocalFile(mFile, targetPath, mTargetParentPath);
         } 
         // TODO handle ResultCode.PARTIAL_MOVE_DONE in client Activity, for the moment