Java Create Directory mkDir(String destDir, String dirName)

Here you can find the source of mkDir(String destDir, String dirName)

Description

mk Dir

License

Open Source License

Declaration

public static void mkDir(String destDir, String dirName) 

Method Source Code

//package com.java2s;
/**//from w ww .  ja  va 2 s.co m
 * Copyright(c) 2005 Dragonfly - created by FengChun
 * All Rights Reserved.
 * 
 * @license: Dragonfly Common License
 * @date 2005-5-16
 */

import java.io.File;

public class Main {
    public static String PATH_CHAR = "" + File.separatorChar;

    public static void mkDir(String destDir, String dirName) {
        File target = new File(destDir + PATH_CHAR + dirName);
        if (!target.exists()) {
            if (!target.mkdir())
                throw new RuntimeException("The Directory can't create:" + target.getPath());
        }
    }
}

Related

  1. mkdir(final File file)
  2. mkdir(final String directory)
  3. mkDir(final String folderPath)
  4. mkdir(String dir)
  5. mkdir(String dir, String file)
  6. mkdir(String dir_str)
  7. mkdir(String directory)