Hi everyone.  I have a build step descriptor with the following code:

        /**
         * Called automatically by Jenkins whenever the "projectFile"
         * field is modified by the user.
         * @param value the new path.
         */
        public FormValidation doCheckProjectFile(@AncestorInPath 
AbstractProject project, @QueryParameter String value) throws IOException {
            if (value == null || value.trim().isEmpty()) {
                return FormValidation.error("Project directory is 
required.");
            } else {
                // Make sure the directory exists.
                return 
FilePath.validateFileMask(project.getSomeWorkspace(), value);
            }
        }

This works as expected, until the user tries to input a path containing 
${WORKSPACE}, at which point the validation promptly fails.  I know I can 
expand environment variables during the actual build, using the build's 
EnvVars object, but I couldn't find any way to get an EnvVars instance from 
the validation method.

Is there a way to do this?  Any help would be appreciated.

-- Matt

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to