updated to use structured form submission.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@6132 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-11-30 07:07:53 +00:00
1 parent 89a71a426f
commit 8403cc77b2
2 files changed
+11 -10

No files matched your search

@@ -11,11 +11,14 @@ import hudson.model.Result;
import hudson.util.FormFieldValidator;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.DataBoundConstructor;
import javax.servlet.ServletException;
import java.io.File;
import java.io.IOException;
import net.sf.json.JSONObject;
/**
* Copies the artifacts into an archive directory.
*
@@ -38,9 +41,10 @@ public class ArtifactArchiver extends Publisher {
*/
private final boolean latestOnly;
@DataBoundConstructor
public ArtifactArchiver(String artifacts, String excludes, boolean latestOnly) {
this.artifacts = artifacts;
this.excludes = excludes;
this.artifacts = artifacts.trim();
this.excludes = Util.fixEmptyAndTrim(excludes);
this.latestOnly = latestOnly;
}
@@ -125,11 +129,8 @@ public class ArtifactArchiver extends Publisher {
new FormFieldValidator.WorkspaceFileMask(req,rsp).process();
}
public Publisher newInstance(StaplerRequest req) {
return new ArtifactArchiver(
req.getParameter("artifacts").trim(),
Util.fixEmpty(req.getParameter("artifacts_excludes").trim()),
req.getParameter("artifacts_latest_only")!=null);
public ArtifactArchiver newInstance(StaplerRequest req, JSONObject formData) throws FormException {
return req.bindJSON(ArtifactArchiver.class,formData);
}
}
}