From f1e701ecf46787f8368d2a4159a1d4ad2e368de5 Mon Sep 17 00:00:00 2001 From: kohsuke Date: Sun, 16 Sep 2007 00:34:48 +0000 Subject: [PATCH] added hook for derived types. git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@4766 71c3de6d-444a-0410-be80-ed276b4c234a --- .../main/java/hudson/util/FormFieldValidator.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/hudson/util/FormFieldValidator.java b/core/src/main/java/hudson/util/FormFieldValidator.java index a657336dee..24288e685b 100644 --- a/core/src/main/java/hudson/util/FormFieldValidator.java +++ b/core/src/main/java/hudson/util/FormFieldValidator.java @@ -269,8 +269,9 @@ public abstract class FormFieldValidator { if(exe.indexOf(File.separatorChar)>=0) { // this is full path - if(new File(exe).exists()) { - ok(); + File f = new File(exe); + if(f.exists()) { + checkExecutable(f); } else { error("There's no such file: "+exe); } @@ -279,5 +280,12 @@ public abstract class FormFieldValidator { ok(); } } + + /** + * Provides an opportunity for derived classes to do additional checks on the executable. + */ + protected void checkExecutable(File exe) throws IOException, ServletException { + ok(); + } } }