i'm trying to create a new file with this code but i have the "java.io.IOException: open failed: ENOENT (No such file or directory)"

This is my code: i hope you can help me.

```
final File f = new File(Environment.
    getExternalStoragePublicDirectory(
        Environment.DIRECTORY_DOWNLOADS).getPath() + "/"
                    + MainActivity.getContext().getPackageName() 
                    + "/wifip2pshared-" + System.currentTimeMillis()
                    + ".jpg");
Log.d("WIFI","file created :"+f.getAbsolutePath());
File dirs = new File(f.getParent());
Log.d("WIFI","dir created :"+dirs.getAbsolutePath());
dirs.mkdirs();
f.createNewFile();    

```

And I did declare the permission in the android manifest.