Java Directory Check checkDirs(File f)

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

Description

Make parent directories of the given file if no existing.

License

Open Source License

Parameter

Parameter Description
f The file to be checked.

Declaration

public static void checkDirs(File f) 

Method Source Code

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

import java.io.File;

public class Main {
    /**/* w ww .  jav a 2  s. c  o  m*/
     * Make parent directories of the given file if no existing.
     * 
     * @param f
     *            The file to be checked.
     */
    public static void checkDirs(File f) {
        if (!f.getParentFile().exists()) {
            f.getParentFile().mkdirs();
        }

    }
}

Related

  1. checkDirectory(final String dir, final boolean create, final String errorDirName)
  2. checkDirectory(String value)
  3. checkDirectoryArray(String[] names)
  4. checkDirectoryInWorkspace(String directoryName)
  5. checkDirPath(final String path)
  6. checkDirs(String dir)
  7. checkDirs(String dirName)