Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
[JENKINS-34759] [JENKINS-34760] Use validateAnt* method rather than v…
…alidateFile*.
  • Loading branch information
uhafner committed May 18, 2016
1 parent 0055ce3 commit fa460e345c63d8980cad9271e14eeec3b14c68b9
Showing with 17 additions and 7 deletions.
  1. +17 −7 src/main/java/hudson/plugins/analysis/core/PluginDescriptor.java
@@ -188,7 +188,7 @@ public FormValidation doCheckDefaultEncoding(@QueryParameter final String defaul
}

/**
* Performs on-the-fly validation on the file name pattern.
* Performs on-the-fly validation on the ant pattern for input files.
*
* @param project
* the project
@@ -200,13 +200,23 @@ public FormValidation doCheckDefaultEncoding(@QueryParameter final String defaul
*/
public FormValidation doCheckPattern(@AncestorInPath final AbstractProject<?, ?> project,
@QueryParameter final String pattern) throws IOException {
if (project != null) {
return FilePath.validateFileMask(project.getSomeWorkspace(), pattern);
}
else {
// Workflow jobs have no workspace
return FormValidation.ok();
if (project != null) { // Workflow jobs have no workspace
try {
FilePath workspace = project.getSomeWorkspace();
if (workspace != null) {
String result = workspace.validateAntFileMask(pattern,
FilePath.VALIDATE_ANT_FILE_MASK_BOUND);
if (result != null) {
return FormValidation.error(result);
}
}
}
catch (InterruptedException e) {
// ignore and return ok
}
}

return FormValidation.ok();
}

/**

0 comments on commit fa460e3

Please sign in to comment.