Here you can find the source of checkDir(final String dirName)
Parameter | Description |
---|---|
dirName | a file name to test. |
public static boolean checkDir(final String dirName)
//package com.java2s; import java.io.File; public class Main { /**/*ww w.j ava 2s .com*/ * Checks to see if the given directory name corresponds to a directory that * exists and can be read. * * @param dirName a file name to test. * @return true iff dirName exists, is a directory and can be read. */ public static boolean checkDir(final String dirName) { return checkDir(new File(dirName)); } /** * Checks to see if the given file exists and is a directory. * * @param f a File to test. * @return true iff f exists and is a directory. */ public static boolean checkDir(final File f) { return f.exists() && f.isDirectory(); } }