Here you can find the source of isValidDir(String dirName, boolean allowMissing)
public static boolean isValidDir(String dirName, boolean allowMissing)
//package com.java2s; //License from project: Open Source License import java.io.File; public class Main { public static boolean isValidDir(String dirName, boolean allowMissing) { if (dirName == null || dirName.trim().isEmpty()) { return false; }// ww w. j av a 2s. com dirName = dirName.trim(); File dir = new File(dirName); return dir.isDirectory() || (allowMissing && !dir.exists()); } }