From 021634e2bbdf5da6d5b8e238a76685e1a2ead198 Mon Sep 17 00:00:00 2001 From: Peter Donald Date: Sun, 21 Jan 2001 00:41:54 +0000 Subject: [PATCH] If directory is specified test if it's a valid one. Submitted By: "Nico Seessle" git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268493 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/ExecTask.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main/org/apache/tools/ant/taskdefs/ExecTask.java b/src/main/org/apache/tools/ant/taskdefs/ExecTask.java index 60a51f44c..0a4fcaaae 100644 --- a/src/main/org/apache/tools/ant/taskdefs/ExecTask.java +++ b/src/main/org/apache/tools/ant/taskdefs/ExecTask.java @@ -170,6 +170,12 @@ public class ExecTask extends Task { if (cmdl.getExecutable() == null) { throw new BuildException("no executable specified", location); } + if (dir != null && !dir.exists()) { + throw new BuildException("The directory you specified does not exist"); + } + if (dir != null && !dir.isDirectory()) { + throw new BuildException("The directory you specified is not a directory"); + } } /**