Created
October 26, 2011 03:59
-
-
Save jorgenpt/1315395 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public FormValidation doCheckOsVersion(@QueryParameter String value) { | |
return doCheckOsVersion(value, true).getFormValidation(); | |
} | |
private ValidationResult doCheckOsVersion(String osVersion, boolean allowVariables) { | |
if (osVersion == null || osVersion.equals("")) { | |
return ValidationResult.error(Messages.OS_VERSION_REQUIRED()); | |
} | |
if (!allowVariables && osVersion.matches(Constants.REGEX_VARIABLE)) { | |
return ValidationResult.error(Messages.INVALID_OS_VERSION()); | |
} | |
return ValidationResult.ok(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment