Java Code Examples for org.apache.cxf.common.util.StringUtils#split()

The following examples show how to use org.apache.cxf.common.util.StringUtils#split() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: AbstractBindingPolicyValidator.java    From steady with Apache License 2.0 6 votes vote down vote up
/**
 * Validate the entire header and body signature property.
 */
protected boolean validateEntireHeaderAndBodySignatures(
    List<WSSecurityEngineResult> signedResults
) {
    for (WSSecurityEngineResult signedResult : signedResults) {
        List<WSDataRef> dataRefs = 
                CastUtils.cast((List<?>)signedResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS));
        for (WSDataRef dataRef : dataRefs) {
            String xpath = dataRef.getXpath();
            if (xpath != null) {
                String[] nodes = StringUtils.split(xpath, "/");
                // envelope/Body || envelope/Header/header || envelope/Header/wsse:Security/header
                if (nodes.length == 5 && nodes[3].contains("Security")) {
                    continue;
                } else if (nodes.length < 3 || nodes.length > 4) {
                    return false;
                }
            }
        }
    }
    return true;
}
 
Example 2
Source File: AbstractBindingPolicyValidator.java    From steady with Apache License 2.0 6 votes vote down vote up
/**
 * Validate the entire header and body signature property.
 */
protected boolean validateEntireHeaderAndBodySignatures(
    List<WSSecurityEngineResult> signedResults
) {
    for (WSSecurityEngineResult signedResult : signedResults) {
        List<WSDataRef> dataRefs = 
                CastUtils.cast((List<?>)signedResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS));
        for (WSDataRef dataRef : dataRefs) {
            String xpath = dataRef.getXpath();
            if (xpath != null) {
                String[] nodes = StringUtils.split(xpath, "/");
                // envelope/Body || envelope/Header/header || envelope/Header/wsse:Security/header
                if (nodes.length == 5 && nodes[3].contains("Security")) {
                    continue;
                } else if (nodes.length < 3 || nodes.length > 4) {
                    return false;
                }
            }
        }
    }
    return true;
}
 
Example 3
Source File: AbstractBindingPolicyValidator.java    From steady with Apache License 2.0 6 votes vote down vote up
/**
 * Validate the entire header and body signature property.
 */
protected boolean validateEntireHeaderAndBodySignatures(
    List<WSSecurityEngineResult> signedResults
) {
    for (WSSecurityEngineResult signedResult : signedResults) {
        List<WSDataRef> dataRefs = 
                CastUtils.cast((List<?>)signedResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS));
        for (WSDataRef dataRef : dataRefs) {
            String xpath = dataRef.getXpath();
            if (xpath != null) {
                String[] nodes = StringUtils.split(xpath, "/");
                // envelope/Body || envelope/Header/header || envelope/Header/wsse:Security/header
                if (nodes.length == 5 && nodes[3].contains("Security")) {
                    continue;
                } else if (nodes.length < 3 || nodes.length > 4) {
                    return false;
                }
            }
        }
    }
    return true;
}
 
Example 4
Source File: AbstractBindingPolicyValidator.java    From steady with Apache License 2.0 6 votes vote down vote up
/**
 * Validate the entire header and body signature property.
 */
protected boolean validateEntireHeaderAndBodySignatures(
    List<WSSecurityEngineResult> signedResults
) {
    for (WSSecurityEngineResult signedResult : signedResults) {
        List<WSDataRef> dataRefs = 
                CastUtils.cast((List<?>)signedResult.get(WSSecurityEngineResult.TAG_DATA_REF_URIS));
        for (WSDataRef dataRef : dataRefs) {
            String xpath = dataRef.getXpath();
            if (xpath != null) {
                String[] nodes = StringUtils.split(xpath, "/");
                // envelope/Body || envelope/Header/header || envelope/Header/wsse:Security/header
                if (nodes.length == 5 && nodes[3].contains("Security")) {
                    continue;
                } else if (nodes.length < 3 || nodes.length > 4) {
                    return false;
                }
            }
        }
    }
    return true;
}
 
Example 5
Source File: BlanketApproveTest.java    From rice with Educational Community License v2.0 5 votes vote down vote up
public ProcessDocReport doRouteStatusChange(DocumentRouteStatusChange statusChangeEvent) throws Exception {

            if (KewApiConstants.ROUTE_HEADER_PROCESSED_CD.equals(statusChangeEvent.getNewRouteStatus())) {
                // Using KimApiServiceLocator to avoid issues with static class and getPrincipalIdFromName
                String principalId = KimApiServiceLocator
                        .getIdentityService().getPrincipalByPrincipalName(TEST_USER_EWESTFAL).getPrincipalId();
                WorkflowDocument parentDocument = WorkflowDocumentFactory.loadDocument(principalId, statusChangeEvent.getDocumentId());
                List<WorkflowAttributeDefinition> attributeDefinitions = parentDocument.getAttributeDefinitions();

                // Workaround to get document id  for chained blanket approve test
                String documentContent = parentDocument.getDocumentContent().getFullContent();
                String documentId = StringUtils.split(documentContent, "\\<(\\/)?documentId\\>")[1];
                WorkflowDocument childDocument = WorkflowDocumentFactory.loadDocument(principalId, documentId);
                childDocument.blanketApprove("");

                // Standard approach (attribute definition not coming across)
                for(WorkflowAttributeDefinition attributeDefinition: parentDocument.getAttributeDefinitions()) {
                    if(ChainedParentSetup.CHILD_DOC_ATTRIBUTE.equals(attributeDefinition.getAttributeName())) {
                        String childDocumentId = attributeDefinition.getPropertyDefinitionsAsMap().get(ChainedParentSetup.DOC_ID_PROPERTY);
                        WorkflowDocument childDocumentItem = WorkflowDocumentFactory.loadDocument(principalId, childDocumentId);
                        childDocumentItem.blanketApprove("");
                    }
                }
            }

            return new ProcessDocReport(true);
        }