Java mkdir makeDirectory(String path, String directoryName)

Here you can find the source of makeDirectory(String path, String directoryName)

Description

Create a directory in the given path

License

Open Source License

Declaration

public static boolean makeDirectory(String path, String directoryName) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2011 MadRobot./*from  w  w  w . j a  va2  s. c  o m*/
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the GNU Lesser Public License v2.1
 * which accompanies this distribution, and is available at
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
 * 
 * Contributors:
 *  Elton Kent - initial API and implementation
 ******************************************************************************/

import java.io.File;

public class Main {
    /**
     * Create a directory in the given <code>path</code>
     */
    public static boolean makeDirectory(String path, String directoryName) {
        File f = new File(path, directoryName);
        if (!f.exists()) {
            return f.mkdir();
        }
        return false;
    }
}

Related

  1. MakeDirectory(String name)
  2. makeDirectory(String name)
  3. makeDirectory(String newDirString)
  4. makeDirectory(String outputDirectory, String directoryName)
  5. makeDirectory(String path)
  6. makeDirectory(String sDir)
  7. makeDirectoryWorldAccessible(File directory)
  8. makeDirForPath(String path)
  9. makeDirIfNotExists(File... paths)