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(); + } } }