Java Directory Check checkDirAndCreate(File dir)

Here you can find the source of checkDirAndCreate(File dir)

Description

Checks a directory for existence and creates it if non-existent.

License

Apache License

Parameter

Parameter Description
dir directory to check/create

Declaration

public static void checkDirAndCreate(File dir) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.io.File;

public class Main {
    /**/*  w  w w .j av a 2 s.c  o  m*/
     * Checks a directory for existence and creates it if non-existent.
     * 
     * @param dir
     *            directory to check/create
     */
    public static void checkDirAndCreate(File dir) {
        if (!dir.exists())
            dir.mkdirs();
    }
}

Related

  1. checkDir(String dirName)
  2. checkDir(String name)
  3. checkDir(String path)
  4. checkDir(String path)
  5. checkDir(String pDir)
  6. checkDirCopy(File srcDir, File destDir)
  7. checkDirectory(File dir)
  8. checkDirectory(File directory)
  9. checkDirectory(File directory)