Java Create Directory mkDir(String DirectoryName)

Here you can find the source of mkDir(String DirectoryName)

Description

mk Dir

License

Apache License

Declaration

public static boolean mkDir(String DirectoryName) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.io.*;

public class Main {

    public static boolean mkDir(String DirectoryName) {
        boolean bRet = false;
        java.io.File file = new java.io.File(DirectoryName);
        if (!file.exists() && file.mkdirs()) {
            bRet = true;// w w  w . j  ava 2  s.  c  o m
        }
        return bRet;
    }

    public static void mkdirs(String destDir) {
        File dir = new File(destDir);
        if (!dir.exists()) {
            dir.mkdirs();
        }
    }
}

Related

  1. mkdir(String dir_str)
  2. mkdir(String directory)
  3. mkdir(String directory)
  4. mkdir(String directory)
  5. mkdir(String directoryName)
  6. mkdir(String dirname)
  7. mkdir(String dirPath, boolean del)
  8. mkdir(String dname)
  9. mkdir(String folder)