Java Create Directory mkdirs(File folder)

Here you can find the source of mkdirs(File folder)

Description

mkdirs

License

Open Source License

Declaration

public static void mkdirs(File folder) throws RuntimeException 

Method Source Code

//package com.java2s;
/*// www  . j  ava 2s .  c o  m
 * Copyright (c) 2015 Eike Stepper (Berlin, Germany) and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Eike Stepper - initial API and implementation
 */

import java.io.File;

public class Main {
    public static void mkdirs(File folder) throws RuntimeException {
        if (folder != null) {
            if (!folder.isDirectory()) {
                if (!folder.mkdirs()) {
                    throw new RuntimeException("Unable to create directory " + folder.getAbsolutePath()); //$NON-NLS-1$
                }
            }
        }
    }
}

Related

  1. mkdir(String sFullDirName)
  2. mkDirAndFile(File file)
  3. mkdirIfMissing(File dir)
  4. mkdirIfNotExists(File dir)
  5. mkDirRec(File file)
  6. mkdirs(File outdir, String path)
  7. mkdirs(File parent, String name, boolean mkdirs)
  8. mkDirs(File path)
  9. mkdirs(File path)