Java Create Directory mkdir(String save)

Here you can find the source of mkdir(String save)

Description

mkdir

License

Open Source License

Declaration

public static void mkdir(String save) 

Method Source Code

//package com.java2s;
/**/*w w  w  .jav a2 s.  c  om*/
 * Copyright (c) 2013 Armin T?pfer
 *
 * This file is part of ProfileSim.
 *
 * ProfileSim 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 3 of the License, or any later version.
 *
 * ProfileSim 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
 * ProfileSim. If not, see <http://www.gnu.org/licenses/>.
 */

import java.io.*;

public class Main {
    public static void mkdir(String save) {
        if (!new File(save).exists()) {
            if (!new File(save).mkdirs()) {
                throw new RuntimeException("Cannot create directory: " + save);
            }
        }
    }
}

Related

  1. mkdir(String name, File dir)
  2. mkdir(String path)
  3. mkdir(String path)
  4. mkDir(String path)
  5. mkdir(String s)
  6. mkdir(String sFullDirName)
  7. mkDirAndFile(File file)
  8. mkdirIfMissing(File dir)
  9. mkdirIfNotExists(File dir)