Explicitly verify that source exists
@@ -228,6 +228,8 @@ public abstract class IOUtils {
* others not, i.e this method is not exception safe
*/
public static void copyDirectory(File sourceLocation, File targetLocation, int maxRecurseLevel, FilenameFilter filter) throws IOException {
+ if ( ! sourceLocation.exists()) throw new IllegalArgumentException(sourceLocation.getAbsolutePath() + " does not exist");
+
if ( ! sourceLocation.isDirectory()) { // copy file
InputStream in=null;
OutputStream out=null;
