X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/38e0f06fb8b9b3b5daa749ddaa1b6a9820cef87f..7295820d57a7de182b565f8f0cb6f6faffa52ce8:/src/com/owncloud/android/services/OperationsService.java diff --git a/src/com/owncloud/android/services/OperationsService.java b/src/com/owncloud/android/services/OperationsService.java index 3a9b3484..c3082d42 100644 --- a/src/com/owncloud/android/services/OperationsService.java +++ b/src/com/owncloud/android/services/OperationsService.java @@ -34,6 +34,7 @@ import com.owncloud.android.lib.resources.files.ExistenceCheckRemoteOperation; import com.owncloud.android.lib.resources.shares.ShareType; import com.owncloud.android.lib.resources.users.GetRemoteUserNameOperation; import com.owncloud.android.operations.common.SyncOperation; +import com.owncloud.android.operations.CreateFolderOperation; import com.owncloud.android.operations.CreateShareOperation; import com.owncloud.android.operations.GetServerInfoOperation; import com.owncloud.android.operations.OAuth2GetAccessToken; @@ -68,6 +69,7 @@ public class OperationsService extends Service { public static final String EXTRA_SEND_INTENT = "SEND_INTENT"; public static final String EXTRA_NEWNAME = "NEWNAME"; public static final String EXTRA_REMOVE_LOCAL_COPY = "REMOVE_LOCAL_COPY"; + public static final String EXTRA_CREATE_FULL_PATH = "CREATE_FULL_PATH"; public static final String EXTRA_RESULT = "RESULT"; // TODO review if ALL OF THEM are necessary @@ -87,17 +89,13 @@ public class OperationsService extends Service { public static final String ACTION_GET_USER_NAME = "GET_USER_NAME"; public static final String ACTION_RENAME = "RENAME"; public static final String ACTION_REMOVE = "REMOVE"; + public static final String ACTION_CREATE_FOLDER = "CREATE_FOLDER"; public static final String ACTION_OPERATION_ADDED = OperationsService.class.getName() + ".OPERATION_ADDED"; public static final String ACTION_OPERATION_FINISHED = OperationsService.class.getName() + ".OPERATION_FINISHED"; private ConcurrentLinkedQueue> mPendingOperations = new ConcurrentLinkedQueue>(); - - /* - private ConcurrentMap mOperationResults = - new ConcurrentHashMap(); - */ private ConcurrentMap> mUndispatchedFinishedOperations = @@ -353,7 +351,14 @@ public class OperationsService extends Service { String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH); boolean removeLocalCopy = operationIntent.getBooleanExtra(EXTRA_REMOVE_LOCAL_COPY, true); operation = new RemoveFileOperation(remotePath, removeLocalCopy); + + } else if (action.equals(ACTION_CREATE_FOLDER)) { + // Create Folder + String remotePath = operationIntent.getStringExtra(EXTRA_REMOTE_PATH); + boolean createFullPath = operationIntent.getBooleanExtra(EXTRA_CREATE_FULL_PATH, true); + operation = new CreateFolderOperation(remotePath, createFullPath); } + } } catch (IllegalArgumentException e) {