OC-2097:Fix init test. Fix classpath of oc-test
[pub/Android/ownCloud.git] / src / com / owncloud / android / operations / CreateFolderOperation.java
index 2b72b28..5784333 100644 (file)
 
 package com.owncloud.android.operations;
 
 
 package com.owncloud.android.operations;
 
-import com.owncloud.android.Log_OC;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
 import com.owncloud.android.datamodel.FileDataStorageManager;
 import com.owncloud.android.datamodel.OCFile;
-import com.owncloud.android.operations.remote.CreateRemoteFolderOperation;
+import com.owncloud.android.oc_framework.network.webdav.WebdavClient;
+import com.owncloud.android.oc_framework.operations.remote.CreateRemoteFolderOperation;
+import com.owncloud.android.oc_framework.operations.OnRemoteOperationListener;
+import com.owncloud.android.oc_framework.operations.RemoteOperation;
+import com.owncloud.android.oc_framework.operations.RemoteOperationResult;
 import com.owncloud.android.utils.FileStorageUtils;
 import com.owncloud.android.utils.FileStorageUtils;
+import com.owncloud.android.utils.Log_OC;
 
 
-import eu.alefzero.webdav.WebdavClient;
 
 /**
  * Access to remote operation performing the creation of a new folder in the ownCloud server.
 
 /**
  * Access to remote operation performing the creation of a new folder in the ownCloud server.
@@ -36,6 +39,7 @@ public class CreateFolderOperation extends RemoteOperation implements OnRemoteOp
     
     private static final String TAG = CreateFolderOperation.class.getSimpleName();
     
     
     private static final String TAG = CreateFolderOperation.class.getSimpleName();
     
+    protected String mFolderName;
     protected String mRemotePath;
     protected boolean mCreateFullPath;
     protected FileDataStorageManager mStorageManager;
     protected String mRemotePath;
     protected boolean mCreateFullPath;
     protected FileDataStorageManager mStorageManager;
@@ -47,7 +51,8 @@ public class CreateFolderOperation extends RemoteOperation implements OnRemoteOp
      * @param createFullPath        'True' means that all the ancestor folders should be created if don't exist yet.
      * @param storageManager        Reference to the local database corresponding to the account where the file is contained. 
      */
      * @param createFullPath        'True' means that all the ancestor folders should be created if don't exist yet.
      * @param storageManager        Reference to the local database corresponding to the account where the file is contained. 
      */
-    public CreateFolderOperation(String remotePath, boolean createFullPath, FileDataStorageManager storageManager) {
+    public CreateFolderOperation(String folderName, String remotePath, boolean createFullPath, FileDataStorageManager storageManager) {
+        mFolderName = folderName;
         mRemotePath = remotePath;
         mCreateFullPath = createFullPath;
         mStorageManager = storageManager;
         mRemotePath = remotePath;
         mCreateFullPath = createFullPath;
         mStorageManager = storageManager;
@@ -57,7 +62,7 @@ public class CreateFolderOperation extends RemoteOperation implements OnRemoteOp
 
     @Override
     protected RemoteOperationResult run(WebdavClient client) {
 
     @Override
     protected RemoteOperationResult run(WebdavClient client) {
-        CreateRemoteFolderOperation operation = new CreateRemoteFolderOperation(mRemotePath, mCreateFullPath);
+        CreateRemoteFolderOperation operation = new CreateRemoteFolderOperation(mFolderName, mRemotePath, mCreateFullPath);
         RemoteOperationResult result =  operation.execute(client);
         
         if (result.isSuccess()) {
         RemoteOperationResult result =  operation.execute(client);
         
         if (result.isSuccess()) {
@@ -83,10 +88,9 @@ public class CreateFolderOperation extends RemoteOperation implements OnRemoteOp
        } else {
            Log_OC.e(TAG, mRemotePath + "hasn't been created");
        }
        } else {
            Log_OC.e(TAG, mRemotePath + "hasn't been created");
        }
-           
-        
     }
 
     }
 
+    
     /**
      * Save new directory in local database
      */
     /**
      * Save new directory in local database
      */
@@ -101,5 +105,6 @@ public class CreateFolderOperation extends RemoteOperation implements OnRemoteOp
         Log_OC.d(TAG, "Create directory " + mRemotePath + " in Database");
 
     }
         Log_OC.d(TAG, "Create directory " + mRemotePath + " in Database");
 
     }
-    
+
+
 }
 }