Java Directory Exist Check checkDirExistence(String dir)

Here you can find the source of checkDirExistence(String dir)

Description

check Dir Existence

License

Open Source License

Declaration

public static void checkDirExistence(String dir) 

Method Source Code

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

import java.io.File;

public class Main {
    public static void checkDirExistence(String dir) {
        File f = new File(dir);
        if (!f.isDirectory()) {
            throw new RuntimeException("File: " + f + " is not a dir");
        }/*from ww  w  .j av  a 2s  .  c om*/
        if (!f.exists()) {
            throw new RuntimeException("Dir: " + f + " does not exist");
        }
    }
}

Related

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