Java Directory Create mkdir(File parentDir, String name)

Here you can find the source of mkdir(File parentDir, String name)

Description

mkdir

License

Open Source License

Parameter

Parameter Description
parentDir a parameter
name a parameter

Exception

Parameter Description
IOException an exception

Return

File

Declaration

public static File mkdir(File parentDir, String name) throws IOException 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Manchester Centre for Integrative Systems Biology
 * University of Manchester/*from   w  w w  . j a v  a  2 s .  c  o  m*/
 * Manchester M1 7ND
 * United Kingdom
 * 
 * Copyright (C) 2007 University of Manchester
 * 
 * This program is released under the Academic Free License ("AFL") v3.0.
 * (http://www.opensource.org/licenses/academic.php)
 *******************************************************************************/

import java.io.*;

public class Main {
    /**
     * 
     * @param parentDir
     * @param name
     * @return File
     * @throws IOException
     */
    public static File mkdir(File parentDir, String name) throws IOException {
        final File directory = new File(parentDir, name);

        if (!directory.mkdir()) {
            throw new IOException();
        }

        return directory;
    }
}

Related

  1. mkdir(File f)
  2. mkDir(File file)
  3. mkdir(File file)
  4. mkdir(File file)
  5. mkdir(File parent, String... segments)
  6. mkdirs(File dir)
  7. mkdirs(File dir)
  8. mkdirs(File dir)
  9. mkdirs(File dir)