Java Create Directory mkDir(final String folderPath)

Here you can find the source of mkDir(final String folderPath)

Description

Check if a folder path exists in the file system If not, create it

License

LGPL

Parameter

Parameter Description
String folderPath

Declaration

public static void mkDir(final String folderPath) 

Method Source Code

//package com.java2s;
/*/*from w ww . j a  v  a2  s  .  c  o  m*/
 * JLib - Publicitas Java library v1.2.0.
 *
 * Copyright (c) 2005, 2006, 2007, 2008, 2009 Publicitas SA.
 * Licensed under LGPL (LGPL-LICENSE.txt) license.
 */

import java.io.File;

public class Main {
    /**
     * Check if a folder path exists in the file system
     * If not, create it
     * @param String folderPath 
     */
    public static void mkDir(final String folderPath) {
        final File file = new File(folderPath);
        if (!file.exists()) {
            file.mkdirs();
        }
    }
}

Related

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