Validates the alias data.<p>

@param validationRequest an object containing the alias data to validate

@return the validation result
554738
public CmsAliasEditValidationReply validateAliases(CmsAliasEditValidationRequest validationRequest) {

        List<CmsAliasTableRow> editedData = validationRequest.getEditedData();
        CmsAliasTableRow newEntry = validationRequest.getNewEntry();
        if (newEntry != null) {
            newEntry.setKey((new CmsUUID()).toString());
            editedData.add(newEntry);

        }
        CmsObject cms = m_cms;
        Locale locale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms);
        for (CmsAliasTableRow row : editedData) {
            row.clearErrors();
            validateSingleAliasRow(cms, row);
        }
        Set<String> foundAliasPaths = new HashSet<String>();
        Set<String> duplicateAliasPaths = new HashSet<String>();
        for (CmsAliasTableRow row : editedData) {
            String aliasPath = row.getAliasPath();
            if (foundAliasPaths.contains(aliasPath)) {
                duplicateAliasPaths.add(aliasPath);
            }
            foundAliasPaths.add(aliasPath);
        }
        for (CmsAliasTableRow row : editedData) {
            if (duplicateAliasPaths.contains(row.getAliasPath())) {
                if (row.getPathError() == null) {
                    row.setAliasError(messageDuplicateAliasPath(locale));
                    m_hasErrors = true;
                }
            }
        }
        CmsAliasEditValidationReply result = new CmsAliasEditValidationReply();
        List<CmsAliasTableRow> changedRows = new ArrayList<CmsAliasTableRow>();
        for (CmsAliasTableRow row : editedData) {
            if (row.isChanged()) {
                changedRows.add(row);
            }
        }
        if (newEntry != null) {
            changedRows.remove(newEntry);
        }
        result.setChangedRows(changedRows);
        result.setValidatedNewEntry(newEntry);
        return result;
    }
1305371
@GetMapping("/setting/param/from/url")
    public List<ValidationData> getValidationDataLists(HttpServletRequest req) {
        this.validationSessionComponent.sessionCheck(req);
        ValidationData data = ParameterMapper.requestParamaterToObject(req, ValidationData.class, "UTF-8");
        return this.msgSettingService.getValidationData(data.getParamType(), data.getMethod(), data.getUrl());
    }
551448
def validate_request(request)
      validation_errors = []

      validation_errors << 'Request api method is empty'  unless request.api_method
      validation_errors << 'Request end point is empty'   unless request.end_point
      validation_errors << 'Request data is empty'        unless request.request_fields.any?

      unless Validator.validate_by_rule request.gateway_url, Validator::URL, false
        validation_errors << 'Gateway url does not valid in Request'
      end

      if validation_errors.any?
        raise ValidationError, "Some Request fields are invalid:\n#{validation_errors.join(";\n")}"
      end
    end
478540
private boolean isValid(String request) {

        String tmp = decodePercent(request);
        if(tmp.indexOf('<') != -1 ||
           tmp.indexOf('>') != -1 ) {
            return false;
        }

        return true;
    }
1271046
public boolean validation() throws ParallelTaskInvalidException {

        if (this.getAsyncHttpClient() == null) {
            logger.info("USE DEFAULT HTTP CLIENT: Did not set special asyncHttpClient, will use the current default one: "
                    + HttpClientStore.getInstance()
                            .getHttpClientTypeCurrentDefault().toString());
            this.asyncHttpClient = HttpClientStore.getInstance()
                    .getCurrentDefaultClient();
        }
        
        if (this.getHttpMethod() == null)
            throw new ParallelTaskInvalidException("Missing getHttpMethod!");
        if (this.getHeaderMetadata() == null) {
            logger.info("USE DEFAULT EMPTY HEADER: Did not specify HTTP header. Will use empty header."
                    + " Use .setHeaders to add headers");
            this.setHeaderMetadata(new ParallecHeader());
        }
        // if null it is OK, just set as the default
        if (this.getEntityBody() == null)
                               setEntityBody(PcConstants.COMMAND_VAR_DEFAULT_REQUEST_CONTENT);

        if (this.getRequestPort() == null) {
            setRequestPort("80");
            logger.info("USE DEFAULT PORT: Missing port. SET default port to be 80");
        }

        if (this.getRequestUrlPostfix() == null
                || this.getRequestUrlPostfix().trim().isEmpty()) {
            setRequestUrlPostfix("");
            logger.info("USE DEFAULT URL: RequestUrlPostfix is null or empty. SET as empty \"\". e.g. just want to GET http://parallec.io");
        }
        if (this.isPollable() &&
                this.getHttpPollerProcessor() == null) {
                throw new ParallelTaskInvalidException(
                        "set pollable but httpPollerProcessor is null!! Invalid. please set httpPollerProcessor() ");
        }

        return true;

    }
730563
public void validateAttributesForm(
            AttributeSwapRequest attributeSwapRequest, MessageContext context) {
        final RequestContext requestContext = RequestContextHolder.getRequestContext();
        final ExternalContext externalContext = requestContext.getExternalContext();
        final Set<String> swappableAttributes =
                this.attributeSwapperHelper.getSwappableAttributes(externalContext);

        final Map<String, Attribute> currentAttributes =
                attributeSwapRequest.getCurrentAttributes();
        this.checkAttributesMap(
                context, "currentAttributes", swappableAttributes, currentAttributes);

        final Map<String, Attribute> attributesToCopy = attributeSwapRequest.getAttributesToCopy();
        this.checkAttributesMap(context, "attributesToCopy", swappableAttributes, attributesToCopy);
    }
801399
@Override
    public String validate(DTDValidatorBase v, char[] cbuf, int start, int end, boolean normalize)
        throws XMLStreamException
    {
        while (start < end && WstxInputData.isSpaceChar(cbuf[start])) {
            ++start;
        }

        // Empty value?
        if (start >= end) {
            return reportValidationProblem(v, "Empty ENTITY value");
        }
        --end; // so that it now points to the last char
        while (end > start  && WstxInputData.isSpaceChar(cbuf[end])) {
            --end;
        }

        // Ok, need to check char validity, and also calc hash code:
        char c = cbuf[start];
        if (!WstxInputData.isNameStartChar(c, mCfgNsAware, mCfgXml11) && c != ':') {
            return reportInvalidChar(v, c, "not valid as the first ID character");
        }
        for (int i = start+1; i <= end; ++i) {
            c = cbuf[i];
            if (!WstxInputData.isNameChar(c, mCfgNsAware, mCfgXml11)) {
                return reportInvalidChar(v, c, "not valid as an ID character");
            }
        }

        EntityDecl ent = findEntityDecl(v, cbuf, start, (end - start + 1));
        // only returns if it succeeded...

        return normalize ? ent.getName() : null;
    }
369760
public void validateAliases(
        final CmsUUID uuid,
        final Map<String, String> aliasPaths,
        final AsyncCallback<Map<String, String>> callback) {

        CmsRpcAction<Map<String, String>> action = new CmsRpcAction<Map<String, String>>() {

            /**
             * @see org.opencms.gwt.client.rpc.CmsRpcAction#execute()
             */
            @Override
            public void execute() {

                start(200, true);
                CmsCoreProvider.getVfsService().validateAliases(uuid, aliasPaths, this);
            }

            /**
             * @see org.opencms.gwt.client.rpc.CmsRpcAction#onResponse(java.lang.Object)
             */
            @Override
            protected void onResponse(Map<String, String> result) {

                stop(false);
                callback.onSuccess(result);
            }

        };
        action.execute();
    }
904969
@Override
    public ValidationMessage[] validate(
            String prefix, String uri, PageData page) {
        return super.validate(TYPE_CORE, prefix, uri, page);
    }
275814
@Override
    public org.fcrepo.server.types.gen.Validation validate(String pid,
                                                           String asOfDateTime) {
        assertInitialized();
        try {
            MessageContext ctx = context.getMessageContext();
            return TypeUtility
                    .convertValidationToGenValidation(m_management.validate(ReadOnlyContext
                                                                                        .getSoapContext(ctx),
                                                                                pid,
                                                                                DateUtility
                                                                                        .parseDateOrNull(asOfDateTime)));
        } catch (Throwable th) {
            LOG.error("Error validating", th);
            throw CXFUtility.getFault(th);
        } finally {
            LOG.debug("end: validate");
        }
    }
871748
private boolean validateParameters() {

        boolean allOk = true;

        StringBuffer validationErrors = new StringBuffer(32);
        CmsMessages messages = Messages.get().getBundle(getLocale());

        // check resource parameter presence
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(getParamResource()) || !getCms().existsResource(getParamResource())) {
            allOk = false;
            validationErrors.append(messages.key(Messages.GUI_PROP_CHANGE_VALIDATE_VFS_RESOURCE_0)).append("<br>");
        }

        // check selected property name
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(getParamPropertyName())) {
            allOk = false;
            validationErrors.append(messages.key(Messages.GUI_PROP_CHANGE_VALIDATE_SELECT_PROPERTY_0)).append("<br>");
        }

        // check old property value to look up
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(getParamOldValue())) {
            allOk = false;
            validationErrors.append(messages.key(Messages.GUI_PROP_CHANGE_VALIDATE_OLD_PROP_VALUE_0)).append("<br>");
        } else {
            try {
                // check if there is a place holder in the expression pattern
                // remove it here, because otherwise this is no valid expression pattern
                String oldValue = getParamOldValue();
                if (oldValue.contains(CmsStringUtil.PLACEHOLDER_START)
                    && oldValue.contains(CmsStringUtil.PLACEHOLDER_END)) {
                    oldValue = oldValue.replace(CmsStringUtil.PLACEHOLDER_START, "");
                    oldValue = oldValue.replace(CmsStringUtil.PLACEHOLDER_END, "");
                }
                // compile regular expression pattern
                Pattern.compile(oldValue);
            } catch (PatternSyntaxException e) {
                allOk = false;
                validationErrors.append(messages.key(Messages.GUI_PROP_CHANGE_VALIDATE_OLD_PROP_PATTERN_0)).append(
                    "<br>");
            }
        }

        // check new property value
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(getParamNewValue())) {
            // if no new value was given, set it to the delete value
            setParamNewValue(CmsProperty.DELETE_VALUE);
        }

        setErrorMessage(validationErrors.toString());
        setValidationErrors(!allOk);
        return allOk;
    }
517876
protected T findValidationContext(List<ValidationContext> validationContexts) {
        for (ValidationContext validationContext : validationContexts) {
            if (getRequiredValidationContextType().isInstance(validationContext)) {
                return (T) validationContext;
            }
        }

        return null;
    }
1364412
public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) {

		ActionErrors errors = null;
		// has the maximum length been exceeded?
		Boolean maxLengthExceeded = (Boolean) request.getAttribute(MultipartRequestHandler.ATTRIBUTE_MAX_LENGTH_EXCEEDED);
		if ((maxLengthExceeded != null) && (maxLengthExceeded.booleanValue())) {
			errors = new ActionErrors();
			errors.add(ERROR_PROPERTY_MAX_LENGTH_EXCEEDED, new ActionMessage("maxLengthExceeded"));
		} else if (fileMap.size() > MAX_IMAGES_COUNT) {
			errors = new ActionErrors();
			errors.add(ERROR_PROPERTY_MAX_LENGTH_EXCEEDED, new ActionMessage("maxLengthExceeded"));
		} else {
			// retrieve the file name
			Iterator iter = fileMap.values().iterator();
			while (iter.hasNext()) {
				FormFile file = (FormFile) iter.next();
				String fileName = file.getFileName();
				if ((!fileName.toLowerCase().endsWith(".gif")) && !(fileName.toLowerCase().endsWith(".jpg"))
						&& !(fileName.toLowerCase().endsWith(".png"))) {
					errors = new ActionErrors();
					errors.add("notImage", new ActionMessage("notImage"));
				}
			}
		}
		return errors;
	}
358009
public List<ValidationData> getValidationDatas(ParamType paramType, String key) {
        if (this.urlMap == null || this.validationDataRuleListMap == null) {
            log.info("url map is empty :: " + key );
            return null;
        }

        if (key == null || paramType == null) {
            throw new ValidationLibException("any parameter is null", HttpStatus.INTERNAL_SERVER_ERROR);
        }

        ReqUrl reqUrl = urlMap.get(key);
        if (reqUrl == null) {
            log.info("reqUrl is null :" + key);
            return null;
        }

        return validationDataRuleListMap.get(paramType.getUniqueKey(reqUrl.getUniqueKey()));
    }
92717
public boolean isValid(HttpServletRequest request) {
    String challenge = request.getParameter(CHALLENGE_FIELD_NAME);
    String response = request.getParameter(RESPONSE_FIELD_NAME);    
    return isValid(request, challenge, response);
  }
1288775
@Override
    public String validate(DTDValidatorBase v, char[] cbuf, int start, int end, boolean normalize)
        throws XMLStreamException
    {
        int origLen = end-start;

        // Let's trim leading white space first...
        while (start < end && WstxInputData.isSpaceChar(cbuf[start])) {
            ++start;
        }

        // Empty value?
        if (start >= end) {
            return reportValidationProblem(v, "Empty NMTOKEN value");
        }

        --end; // so that it now points to the last char
        while (end > start && WstxInputData.isSpaceChar(cbuf[end])) {
            --end;
        }

        // Ok, need to check char validity
        for (int i = start; i <= end; ++i) {
            char c = cbuf[i];
            if (!WstxInputData.isNameChar(c, mCfgNsAware, mCfgXml11)) {
                return reportInvalidChar(v, c, "not valid NMTOKEN character");
            }
        }

        if (normalize) {
            // Let's only create the String if we trimmed something
            int len = (end - start)+1;
            if (len != origLen) {
                return new String(cbuf, start, len);
            }
        }
        return null;
    }
849627
public boolean validation() throws ParallelTaskInvalidException {

        if (this.commandLine == null) {
            throw new ParallelTaskInvalidException(
                    "commandSshLine is null for ssh");
        }
        if (this.sshLoginType == null) {
            throw new ParallelTaskInvalidException(
                    "sshLoginType is null for ssh");
        }

        if (this.userName == null) {
            throw new ParallelTaskInvalidException("userName is null for ssh. "
                    + "UserName is required for both key/password based login");
        }


        if (this.sshLoginType == SshLoginType.PASSWORD && password == null) {
            throw new ParallelTaskInvalidException(
                    "use password but it is null for ssh");
        }
        if (this.sshLoginType == SshLoginType.KEY
                && this.privKeyRelativePath == null) {
            throw new ParallelTaskInvalidException(
                    "use public key but private key path is null for ssh");
        }

        if (this.sshLoginType == SshLoginType.KEY
                && this.privKeyUsePassphrase && this.passphrase == null) {
            throw new ParallelTaskInvalidException(
                    "use public key and also with private key passphrase but it is null for ssh");
        }

        return true;

    }