mirror of
https://github.com/SimpleMobileTools/Simple-File-Manager.git
synced 2025-06-05 22:09:15 +02:00
check for already existing files or directories
This commit is contained in:
@ -163,7 +163,11 @@ public class ItemsFragment extends android.support.v4.app.Fragment
|
||||
final EditText itemName = (EditText) newItemView.findViewById(R.id.item_name);
|
||||
final String name = itemName.getText().toString().trim();
|
||||
if (Utils.isNameValid(name)) {
|
||||
File file = new File(mPath, name);
|
||||
final File file = new File(mPath, name);
|
||||
if (file.exists()) {
|
||||
Utils.showToast(getContext(), R.string.name_taken);
|
||||
return;
|
||||
}
|
||||
final RadioGroup radio = (RadioGroup) newItemView.findViewById(R.id.dialog_radio_group);
|
||||
if (radio.getCheckedRadioButtonId() == R.id.dialog_radio_directory) {
|
||||
if (!createDirectory(file, alertDialog)) {
|
||||
|
Reference in New Issue
Block a user