I am using the following code to create folder but it does not create it (output is failed) and does not throw any exception.

Folder java is already created, I need to pass the folder name and create it in the java folder.

```
private String CreateFolder(String myfolder) {
        try {
            String dir = "../Java/" + myfolder;
            boolean result = false;
            File directory = new File(dir);

            if (!directory.exists()) {
                result = directory.mkdir();

                if (result) {
                    System.out.println("Folder is created");
                    return dir;
                } else {
                    return "failed";
                }
            }
        }catch(Exception e) {
            e.printStackTrace();
        }
        return "";
    }

```