Java Directory Create mkdirs(File f)

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

Description

Makes sure that the directory in which the file is exists.

License

Open Source License

Parameter

Parameter Description
f The file.

Declaration

public static void mkdirs(File f) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.io.*;

public class Main {
    /**/*from w  ww.  j a v  a 2  s.c o m*/
     * Makes sure that the directory in which the file is exists.
     * If this one doesn't exist, i'll be created.
     * 
     * @param f The file.
     */
    public static void mkdirs(File f) {
        File p = f.getParentFile();
        if (!p.exists())
            p.mkdirs();
    }
}

Related

  1. mkdirs(File directory)
  2. mkdirs(File directory, String string)
  3. mkdirs(File dirs)
  4. mkdirs(File dumpFile)
  5. mkDirs(File f)
  6. mkdirs(File f)
  7. mkdirs(File f)
  8. mkdirs(File f)
  9. mkdirs(File file)