diff --git a/core/pom.xml b/core/pom.xml index 518df5bf48cd0e85ed3fc0c1da301cc7d99b519a..3a718d372df39e8b1197cbdf89200292bb534d1d 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -319,7 +319,7 @@ THE SOFTWARE. org.kohsuke.stapler stapler-jelly - 1.106 + 1.107 dom4j diff --git a/core/src/main/java/hudson/matrix/MatrixProject.java b/core/src/main/java/hudson/matrix/MatrixProject.java index c83786fa4d52c5616dc229170085e6c709a52ea5..97cffe130c5b3f22fe247e921f6422056cae124b 100644 --- a/core/src/main/java/hudson/matrix/MatrixProject.java +++ b/core/src/main/java/hudson/matrix/MatrixProject.java @@ -78,6 +78,7 @@ import net.sf.json.JSONObject; import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; +import org.kohsuke.stapler.HttpResponse; /** * {@link Job} that allows you to run multiple different configurations @@ -542,6 +543,17 @@ public class MatrixProject extends AbstractProject im rebuildConfigurations(); } + /** + * Also delete all the workspaces of the configuration, too. + */ + @Override + public HttpResponse doDoWipeOutWorkspace() throws IOException, ServletException, InterruptedException { + HttpResponse rsp = super.doDoWipeOutWorkspace(); + for (MatrixConfiguration c : configurations.values()) + c.doDoWipeOutWorkspace(); + return rsp; + } + public DescriptorImpl getDescriptor() { return DESCRIPTOR; } diff --git a/core/src/main/java/hudson/model/AbstractProject.java b/core/src/main/java/hudson/model/AbstractProject.java index 4a96fd5234a9cee7b2dad8c499c3eda5d4127aa1..9ac065a3190b715e552691916068f17eacd0cc65 100644 --- a/core/src/main/java/hudson/model/AbstractProject.java +++ b/core/src/main/java/hudson/model/AbstractProject.java @@ -61,6 +61,9 @@ import org.kohsuke.stapler.StaplerRequest; import org.kohsuke.stapler.StaplerResponse; import org.kohsuke.stapler.export.Exported; import org.kohsuke.stapler.QueryParameter; +import org.kohsuke.stapler.HttpResponse; +import org.kohsuke.stapler.HttpRedirect; +import org.kohsuke.stapler.ForwardToView; import javax.servlet.ServletException; @@ -1251,29 +1254,28 @@ public abstract class AbstractProject

,R extends A /** * Wipes out the workspace. */ - public void doDoWipeOutWorkspace(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException, InterruptedException { + public HttpResponse doDoWipeOutWorkspace() throws IOException, ServletException, InterruptedException { checkPermission(BUILD); if (getScm().processWorkspaceBeforeDeletion(this, getWorkspace(), null)) { getWorkspace().deleteRecursive(); - rsp.sendRedirect2("."); - } - // If we get here, that means the SCM blocked the workspace deletion. - else { - req.getView(this, "wipeOutWorkspaceBlocked.jelly").forward(req, rsp); + return new HttpRedirect("."); + } else { + // If we get here, that means the SCM blocked the workspace deletion. + return new ForwardToView(this,"wipeOutWorkspaceBlocked.jelly"); } } - public void doDisable(StaplerResponse rsp) throws IOException, ServletException { + public HttpResponse doDisable() throws IOException, ServletException { requirePOST(); checkPermission(CONFIGURE); makeDisabled(true); - rsp.sendRedirect2("."); + return new HttpRedirect("."); } - public void doEnable(StaplerResponse rsp) throws IOException, ServletException { + public HttpResponse doEnable() throws IOException, ServletException { checkPermission(CONFIGURE); makeDisabled(false); - rsp.sendRedirect2("."); + return new HttpRedirect("."); } /**