diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java index 321dd3a2c62e5dfcf158643fc876fad780fd1e87..8d8254ec250a729b9ace5fc659417a06d5d411d1 100644 --- a/core/src/main/java/hudson/FilePath.java +++ b/core/src/main/java/hudson/FilePath.java @@ -913,8 +913,17 @@ public final class FilePath implements Serializable { */ public Future actAsync(final FileCallable callable) throws IOException, InterruptedException { try { + DelegatingCallable wrapper = new FileCallableWrapper(callable); + Jenkins instance = Jenkins.getInstance(); + if (instance != null) { // this happens during unit tests + ExtensionList factories = instance.getExtensionList(FileCallableWrapperFactory.class); + for (FileCallableWrapperFactory factory : factories) { + wrapper = factory.wrap(wrapper); + } + } + return (channel!=null ? channel : Jenkins.MasterComputer.localChannel) - .callAsync(new FileCallableWrapper(callable)); + .callAsync(wrapper); } catch (IOException e) { // wrap it into a new IOException so that we get the caller's stack trace as well. throw new IOException2("remote file operation failed",e);