-/* ownCloud Android client application
- * Copyright (C) 2014 ownCloud Inc.
+/**
+ * ownCloud Android client application
+ *
+ * @author David A. Velasco
+ * Copyright (C) 2015 ownCloud Inc.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2,
package com.owncloud.android.ui.dialog;
import com.actionbarsherlock.app.SherlockDialogFragment;
+import com.owncloud.android.MainApp;
import com.owncloud.android.R;
import com.owncloud.android.datamodel.OCFile;
import com.owncloud.android.lib.resources.files.FileUtils;
/**
* Dialog to input the name for a new folder to create.
*
- * Triggers the folder creation when name is confirmed.
- *
- * @author David A. Velasco
+ * Triggers the folder creation when name is confirmed.
*/
public class CreateFolderDialogFragment
extends SherlockDialogFragment implements DialogInterface.OnClickListener {
private static final String ARG_PARENT_FOLDER = "PARENT_FOLDER";
+
+ public static final String CREATE_FOLDER_FRAGMENT = "CREATE_FOLDER_FRAGMENT";
/**
* Public factory method to create new CreateFolderDialogFragment instances.
*
- * @param file File to remove.
- * @return Dialog ready to show.
+ * @param parentFolder Folder to create
+ * @return Dialog ready to show.
*/
public static CreateFolderDialogFragment newInstance(OCFile parentFolder) {
CreateFolderDialogFragment frag = new CreateFolderDialogFragment();
Toast.LENGTH_LONG).show();
return;
}
-
- if (!FileUtils.isValidName(newFolderName)) {
+
+
+ if (!FileUtils.isValidName(newFolderName,
+ ((ComponentsGetter)getSherlockActivity()).
+ getFileOperationsHelper().isVersionWithForbiddenCharacters())) {
Toast.makeText(
getSherlockActivity(),
R.string.filename_forbidden_characters,