|
35 | 35 | import hudson.model.AbstractProject; |
36 | 36 | import hudson.model.BuildListener; |
37 | 37 | import hudson.model.Descriptor; |
| 38 | +import hudson.model.Item; |
38 | 39 | import hudson.model.Result; |
39 | 40 | import hudson.model.Run; |
40 | 41 | import hudson.model.Saveable; |
|
58 | 59 | import jenkins.tasks.SimpleBuildStep; |
59 | 60 | import org.apache.tools.ant.DirectoryScanner; |
60 | 61 | import org.apache.tools.ant.types.FileSet; |
| 62 | +import org.kohsuke.stapler.AncestorInPath; |
61 | 63 | import org.kohsuke.stapler.DataBoundConstructor; |
62 | 64 | import org.kohsuke.stapler.DataBoundSetter; |
63 | 65 | import org.kohsuke.stapler.QueryParameter; |
@@ -544,6 +546,22 @@ public String getDisplayName() { |
544 | 546 | return Messages.JUnitResultArchiver_DisplayName(); |
545 | 547 | } |
546 | 548 |
|
| 549 | + /** |
| 550 | + * Performs on-the-fly validation on the file mask wildcard. |
| 551 | + * @param project Project. |
| 552 | + * @param value File mask to validate. |
| 553 | + * |
| 554 | + * @return the validation result. |
| 555 | + * @throws IOException if an error occurs. |
| 556 | + */ |
| 557 | + public FormValidation doCheckTestResults(@AncestorInPath AbstractProject project, @QueryParameter String value) |
| 558 | + throws IOException { |
| 559 | + if (project == null || !project.hasPermission(Item.WORKSPACE)) { |
| 560 | + return FormValidation.ok(); |
| 561 | + } |
| 562 | + return FilePath.validateFileMask(project.getSomeWorkspace(), value); |
| 563 | + } |
| 564 | + |
547 | 565 | @Override |
548 | 566 | public boolean isApplicable(Class<? extends AbstractProject> jobType) { |
549 | 567 | return true; |
|
0 commit comments