Java Directory Check checkDir(String dirName)

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

Description

check Dir

License

Open Source License

Declaration

private static boolean checkDir(String dirName) 

Method Source Code


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

import java.io.File;

public class Main {
    private static boolean checkDir(String dirName) {
        File stats = new File(dirName);
        if (stats.exists()) {
            return true;
        } else {// w ww .jav  a2  s . com
            if (stats.mkdir()) {
                return true;
            } else {
                return false;
            }
        }
    }
}

Related

  1. checkDir(final String dirName)
  2. checkDir(final String name)
  3. checkDir(String dir)
  4. checkDir(String dir, boolean mustWrite)
  5. checkDir(String directory)
  6. checkDir(String name)
  7. checkDir(String path)
  8. checkDir(String path)
  9. checkDir(String pDir)