Create directory and directories recursively(mkdir)


import java.io.File;

public class Main {
    public static void main(String[] args) {
        boolean status;
        status = new File("/home/a/bin").mkdir();
        System.out.println(status ? "success" : "failure");
        status = new File("/home/a/src").mkdir();
        System.out.println(status ? "success" : "failure");

        status = new File("/home/a/once/twice/again").mkdir(); // fail
        System.out.println(status ? "success" : "failure");
        status = new File("/home/a/once/twice/again").mkdirs(); // succeed
        System.out.println(status ? "success" : "failure");
    }
}
Home 
  Java Book 
    Runnable examples  

IO Directory:
  1. Create directory and directories recursively(mkdir)
  2. List all files under directory recursively, like UNIX ls or DOS and VMS dir
  3. List root directory