Questions tagged [mkdirs]
87 questions
0
votes
2 answers
I can't backup my realm database in External Directory because of mkdirs()
I am trying to export my realm database in external storage (actually in my cell phone)
When I press the button below method, named backupRealmNow(), works.
public void backupRealmNow() {
Realm nowRealmForBackup = Realm.getDefaultInstance();
…

TyeolRik
- 466
- 2
- 25
0
votes
1 answer
How to append more than two folders to user.home java
guys! I'm trying to append folder to user.home property. It working nice, while I'm using just one additional folder. But when I try to make another two additions (so it looks like user.home+folder1+folder2+folder3) it trows…

Максим Давидюк
- 1
- 1
0
votes
2 answers
Java make directory but not file
So with the code below it creates the file in the folder
File f = new File(path);
if(!f.exists())
f.mkdirs();
, but i only want to create the directory, because after this i use this code
file.transferTo(new File(path));
which saves…

MNJ
- 172
- 1
- 1
- 13
0
votes
1 answer
Android Mashmallow can't create folders on StoragePublicDirectory
I'm working on an application built for Android SKD version 22.
In this application folders are created using this way:
String FileDir = Environment.getExternalStoragePublicDirectory(
Environment.DIRECTORY_PICTURES) + "/" + app_name + "/" +…

MikeKeepsOnShine
- 1,730
- 4
- 23
- 35
0
votes
2 answers
make external directory android
In case of making directory in external storage in android app I use this code:
File mDirectory = new File(Environment.getExternalStorageDirectory() + "/myDir");
if (!mDirectory.exists()) {
mDirectory.mkdirs();
if…

Shima Erfan
- 335
- 1
- 5
- 19
0
votes
1 answer
mkdirs() not working, Camera doesn't go back to my MainActivity
I'm fairly new to Android and I'm trying to use the camera via an intent. I know my permissions for API23 or lower are working. My app successfully opens the camera, but when I hit OK, it doesn't go back to my MainActivity. I found online that the…

Antuan
- 501
- 2
- 6
- 18
0
votes
2 answers
Creating directory in internal storage
I think that my smartphone is a dumbphone.
Trying to create a folder and it seems that it just wont get created.
I am running CyanogenMod and dont know if this make it goes nuts.
This is what I have been testing:
File folder = new File(getFilesDir()…

codemoonger
- 613
- 3
- 11
- 22
0
votes
0 answers
After clear cache on Android File.mkdirs() return false and I Can't create directory
This code works perfectly until you clear cache from Device's Settings/App/your app menu.
/**
* @param context te get packageName & {@code cacheDir} from internal storage
* @return file for {@code cacheDir} either SD card or internal storage. Or…

Roger Alien
- 3,040
- 1
- 36
- 46
0
votes
1 answer
Why my code creates directory on windows but not on linux JAVA
I have mkdirs code like that;
File dir = new File ("/Mydir/");
if(dir.exists()==false) {
dir.mkdirs();
}
it is normal working and create directory on windows but not working on linux..

Ozan
- 1,191
- 2
- 16
- 31
0
votes
0 answers
Input Validation and Representation about System.getProperty & mkdirs
I use the following code:
String workingDir = System.getProperty("user.dir") + File.separator;
new File(workingDir + "tempDir").mkdirs();
After Fortify's vulnerability scanning to obtain the following results: Input Validation and…

Even
- 23
- 5
0
votes
1 answer
application failed to create folder when other application occupy it
This is my question.
First I have create my personal folder on create
File parentFolder = new File(MainApplication.getInstance().getExternalCacheDir().getAbsolutePath()
+ File.separator+"myfolder");
if (!parentFolder.exists()) {
…

user3526542
- 25
- 5
0
votes
1 answer
How to create directory in android framework?
I want to create my directory in android framework.
For example, "/stoage/myTestDir/"
So, i try to add this code in "Kitkat/frameworks/base/services/java/com/android/server/BootReceiver.java".
BootReceiver.java
@Overrinde
public void onReceive(final…

Un-Su Kim
- 1
- 2
0
votes
2 answers
mkdir return false in android?
This is my code
String DATA_PATH="/mnt/sdcard/";
String[] paths = new String[] { DATA_PATH, DATA_PATH + "tessdata/" };
for (String path : paths) {
File dir = new File(path);
if (!dir.exists()) {
…

Rhesa Jonathan
- 11
- 1
- 6
0
votes
1 answer
Error using os.mkdirs in python 2.7 [Win7]
I'm attempting to make a part of a class that will allow me to create a new directory for output files each time an instance is created. However, whenever the mkdir_p function is executed I get this error:
Traceback (most recent call last):
File…

Lostferret
- 39
- 1
- 7
0
votes
1 answer
mkdirs() method not works
I need to make a directory if not exist. I've wrote codes below
File backupDir = new File("//test");
// if (!backupDir.exists())
backupDir.mkdirs();
I've previously used it without any problem, But now not works and I have no errors!…

Mousa Jafari
- 677
- 1
- 6
- 21