Java Create Directory mkdirs(String name)

Here you can find the source of mkdirs(String name)

Description

Creates the directory named by this abstract pathname, including any necessary but nonexistent parent directories.

License

Open Source License

Parameter

Parameter Description
String The direct pathname

Return

boolean Returns true if successful

Declaration

public final static boolean mkdirs(String name) 

Method Source Code

//package com.java2s;
/**//www. j  a v  a2  s .com
 * Copyright (C) 2013-2017
 * Jeffrey Fulmer - <jeff@joedog.org>, et al.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.
 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 *--
 */

import java.io.File;

public class Main {
    /**
     * Creates the directory named by this abstract pathname, 
     * including any necessary but nonexistent parent directories.
     * <p>
     * @param  String  The direct pathname
     * @return boolean Returns true if successful
     */
    public final static boolean mkdirs(String name) {
        File file;
        if (name == null) {
            return false;
        }
        file = new File(name);
        return file.mkdirs();
    }
}

Related

  1. mkdirs(String dirName)
  2. mkdirs(String fileName, String baseName)
  3. mkdirs(String filePath)
  4. mkdirs(String filePath)
  5. mkDirs(String filePath)
  6. mkdirs(String packageName, File root)
  7. mkdirs(String parentName, String childName)
  8. mkDirs(String path)
  9. mkdirs(String path)