Java mkdir makeDir(String parent, String child)

Here you can find the source of makeDir(String parent, String child)

Description

create directory method

License

Open Source License

Parameter

Parameter Description
parent directory
child directory

Declaration

public static synchronized void makeDir(String parent, String child) 

Method Source Code


//package com.java2s;
import java.io.*;

public class Main {
    public static String fileseperator = System.getProperty("file.separator");

    /**/*from  w w  w  .  j av  a 2  s  . c  o  m*/
     * @param path
     */
    public static synchronized void makeDir(String path) {
        File dir = new File(path);
        if (!dir.exists()) {
            dir.mkdirs();
        }
    }

    /**
     * create directory method
     *
     * @param parent directory
     * @param child  directory
     */
    public static synchronized void makeDir(String parent, String child) {
        StringBuffer mkdir = new StringBuffer(parent);
        mkdir.append(fileseperator);
        mkdir.append(child);
        makeDir(mkdir.toString());
    }
}

Related

  1. makeDir(String dir)
  2. MakeDir(String dirName)
  3. MakeDir(String dirpath)
  4. makeDir(String dirPath)
  5. makeDir(String newDirName)
  6. makeDir(String path)
  7. makeDir(String path)
  8. makeDirByChild(File file)
  9. makeDirDirs(String dir)