Java Directory Create mkdir(File f)

Here you can find the source of mkdir(File f)

Description

Same as File.mkdirs() exception IOException is thrown on error.

License

Academic Free License

Declaration

public static void mkdir(File f) throws IOException 

Method Source Code

//package com.java2s;
// Licensed under the Academic Free License version 3.0

import java.io.*;

public class Main {
    /**/*from   w w w . j  av a 2  s.  co m*/
     * Same as File.mkdirs() exception IOException is thrown on error.
     */
    public static void mkdir(File f) throws IOException {
        if (f.exists() && f.isDirectory())
            return;

        if (!f.mkdirs())
            throw new IOException("Cannot mkdir: " + f);
    }
}

Related

  1. mkdir(File directory)
  2. mkdir(File directory)
  3. mkdir(File directory)
  4. mkdir(File dirFile)
  5. mkdir(File dirFile)
  6. mkdir(File f)
  7. mkDir(File file)
  8. mkdir(File file)
  9. mkdir(File file)