From 6b056fa0ab8e965dcca96b1250d3f363698b7f3f Mon Sep 17 00:00:00 2001 From: wolfgarnet Date: Wed, 12 Sep 2012 15:49:48 +0200 Subject: [PATCH] Added callable wrapper to actAsync --- core/src/main/java/hudson/FilePath.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java index 321dd3a2c6..8d8254ec25 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); -- GitLab