Here you can find the source of isValidDirectory(String filePath)
public static boolean isValidDirectory(String filePath)
//package com.java2s; /**//from www . j av a2 s.c om * * Copyright (c) 2015 Fannie Mae, All rights reserved. * This program and the accompany materials are made available under * the terms of the Fannie Mae Open Source Licensing Project available * at https://github.com/FannieMaeOpenSource/ezPie/wiki/License * * ezPIE? is a registered trademark of Fannie Mae * */ import java.io.File; public class Main { public static boolean isValidDirectory(String filePath) { if (filePath == null) return false; File f = new File(filePath); return f.exists() && f.isDirectory(); } public static boolean exists(String filePath) { if (filePath == null) return false; File f = new File(filePath); return f.exists(); } }