Java Directory Exist Check checkDirectoryExists(String path)

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

Description

check Directory Exists

License

Open Source License

Declaration

public static boolean checkDirectoryExists(String path) 

Method Source Code


//package com.java2s;
import java.io.File;

public class Main {
    public static boolean checkDirectoryExists(String path) {
        boolean exists;
        File directory = new File(path);
        exists = directory.exists() || directory.mkdirs();
        return exists;
    }//  w w w. j  av  a 2 s  .  co  m
}

Related

  1. checkDir(String dir, boolean mustExist)
  2. checkDirectory(String name, boolean createIfNonExistent)
  3. checkDirExist(String path)
  4. checkDirExistence(String dir)
  5. checkDirExistenceOrCreateMissingParts(final String dirPath)
  6. checkDirExists(File dir)