Java Directory Check checkDir(String path)

Here you can find the source of checkDir(String path)

Description

check Dir

License

Open Source License

Declaration

public static void checkDir(String path) 

Method Source Code


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

import java.io.File;

public class Main {
    public static void checkDir(String path) {
        File file = new File(path);
        if (!file.exists()) {
            if (!file.mkdirs())
                throw new RuntimeException(String.format("directory %s not create", path));
        }//ww w .  j a v a  2  s . c  o  m
    }
}

Related

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