当前位置: 首页>>代码示例>>Java>>正文


Java StringSupport.trimOrNull方法代码示例

本文整理汇总了Java中net.shibboleth.utilities.java.support.primitive.StringSupport.trimOrNull方法的典型用法代码示例。如果您正苦于以下问题:Java StringSupport.trimOrNull方法的具体用法?Java StringSupport.trimOrNull怎么用?Java StringSupport.trimOrNull使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.shibboleth.utilities.java.support.primitive.StringSupport的用法示例。


在下文中一共展示了StringSupport.trimOrNull方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: doExecute

import net.shibboleth.utilities.java.support.primitive.StringSupport; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
    final String nameNoTag = StringSupport.trimOrNull(getInputMetadata().getName());
    final Map<LangTag, String> map = getInputMetadata().getNameEntries();
    if (nameNoTag != null) {
        log.debug("{} Found client name without name tag: {}", getLogPrefix(), nameNoTag);
        getOutputMetadata().setName(nameNoTag, null);
    }
    if (map != null && !map.isEmpty()) {
        final Iterator<LangTag> tags = map.keySet().iterator();
        while (tags.hasNext()) {
            final LangTag tag = tags.next();
            final String name = StringSupport.trimOrNull(map.get(tag));
            if (name != null) {
                log.debug("{} Found client name {} for language tag {}", getLogPrefix(), name, tag);
                getOutputMetadata().setName(name, tag);
            }
        }
    }
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:22,代码来源:AddClientNameToClientMetadata.java

示例2: doDecode

import net.shibboleth.utilities.java.support.primitive.StringSupport; //导入方法依赖的package包/类
/** {@inheritDoc} */
@Override
protected void doDecode() throws MessageDecodingException {
    final MessageContext<OIDCWebFingerRequest> messageContext = new MessageContext<>();
    final HttpServletRequest httpRequest = getHttpServletRequest();
    final String resource = StringSupport.trimOrNull(httpRequest.getParameter("resource"));
    if (resource == null) {
        log.error("No resource parameter value found from the request");
        throw new MessageDecodingException("Mandatory value for resource is missing");
    }
    final String rel = StringSupport.trim(httpRequest.getParameter("rel"));
    if (rel == null) {
        log.error("No rel parameter value found from the request");
        throw new MessageDecodingException("Mandatory value for rel is missing");
    }
    final OIDCWebFingerRequestImpl request = new OIDCWebFingerRequestImpl(resource, rel);
    log.debug("Decoded Web Finger request with resource = {} and rel = {}", resource, rel);
    messageContext.setMessage(request);
    setMessageContext(messageContext);
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:21,代码来源:OIDCWebFingerRequestDecoder.java

示例3: populateSubject

import net.shibboleth.utilities.java.support.primitive.StringSupport; //导入方法依赖的package包/类
@Override
protected Subject populateSubject(Subject subject) {
	logger.debug("{} TokenValidator populateSubject is called", getLogPrefix());		
	if (StringSupport.trimOrNull(username) != null) {
		logger.debug("{} Populate subject {}", getLogPrefix(), username);
		subject.getPrincipals().add(new UsernamePrincipal(username));
		return subject;
	}
	return null;
}
 
开发者ID:cyber-simon,项目名称:idp-auth-linotp,代码行数:11,代码来源:TokenValidator.java

示例4: doExecute

import net.shibboleth.utilities.java.support.primitive.StringSupport; //导入方法依赖的package包/类
@Override
protected void doExecute(@Nonnull final ProfileRequestContext<SAMLObject, SAMLObject> profileRequestContext,
		@Nonnull final AuthenticationContext authenticationContext) {
	
	final HttpServletRequest request = getHttpServletRequest();

	if (request == null) {
		logger.debug("{} Empty HttpServletRequest", getLogPrefix());
		ActionSupport.buildEvent(profileRequestContext, AuthnEventIds.NO_CREDENTIALS);
		return;
	}

	try {

		TokenContext tokenCtx = authenticationContext.getSubcontext(TokenContext.class, true);

		/** get tokencode from request **/
		String value = StringSupport.trimOrNull(request.getParameter(tokenCodeField));

		if (Strings.isNullOrEmpty(value)) {
			logger.debug("{} Empty tokenCode", getLogPrefix());
			ActionSupport.buildEvent(profileRequestContext, AuthnEventIds.INVALID_CREDENTIALS);
			return;
		} else {
			logger.debug("{} TokenCode: {}", getLogPrefix(), value);

			/** set tokencode to TokenCodeContext **/
			tokenCtx.setToken(value);
			logger.debug("Put Token code to the TokenCodeCtx");
			return;
		}

	} catch (Exception e) {
		logger.warn("{} Login by {} produced exception", getLogPrefix(),  e);
	}		
}
 
开发者ID:cyber-simon,项目名称:idp-auth-linotp,代码行数:37,代码来源:ExtractTokenFromForm.java

示例5: ProxyGrantingTicket

import net.shibboleth.utilities.java.support.primitive.StringSupport; //导入方法依赖的package包/类
/**
 * Creates a proxy-granting ticket with the given values.
 *
 * @param id Ticket ID.
 * @param sessionId IdP session ID used to create ticket.
 * @param service Service that requested the ticket.
 * @param expiration Expiration instant.
 * @param parentId ID of parent proxy-granting ticket or null if this is first proxy in chain.
 */
public ProxyGrantingTicket(
        @Nonnull final String id,
        @Nonnull final String sessionId,
        @Nonnull final String service,
        @Nonnull final Instant expiration,
        @Nullable final String parentId) {
    super(id, sessionId, service, expiration);
    this.parentId = StringSupport.trimOrNull(parentId);
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:19,代码来源:ProxyGrantingTicket.java

示例6: setSuffix

import net.shibboleth.utilities.java.support.primitive.StringSupport; //导入方法依赖的package包/类
/**
 * Sets the ticket ID suffix.
 *
 * @param suffix Ticket suffix.
 */
public void setSuffix(@Nullable final String suffix) {
    final String s = StringSupport.trimOrNull(suffix);
    if (s != null) {
        if (!isUrlSafe(s)) {
            throw new IllegalArgumentException("Unsupported suffix " + s);
        }
        this.suffix = s;
    }
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:15,代码来源:TicketIdentifierGenerationStrategy.java

示例7: Service

import net.shibboleth.utilities.java.support.primitive.StringSupport; //导入方法依赖的package包/类
/**
 * Creates a new service from given URL and group name.
 *
 * @param url CAS service URL.
 * @param group Group to which service belongs.
 * @param proxy True to authorize proxying, false otherwise.
 */
public Service(
        @Nonnull @NotEmpty final String url,
        @Nullable @NotEmpty final String group,
        final boolean proxy) {
    this.serviceURL = Constraint.isNotNull(StringSupport.trimOrNull(url), "Service URL cannot be null or empty");
    this.group = StringSupport.trimOrNull(group);
    this.authorizedToProxy = proxy;
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:16,代码来源:Service.java

示例8: setPgtUrl

import net.shibboleth.utilities.java.support.primitive.StringSupport; //导入方法依赖的package包/类
public void setPgtUrl(@Nonnull final String url) {
    this.pgtUrl = StringSupport.trimOrNull(url);
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:4,代码来源:TicketValidationRequest.java

示例9: setPgtIou

import net.shibboleth.utilities.java.support.primitive.StringSupport; //导入方法依赖的package包/类
public void setPgtIou(@Nullable final String pgtIou) {
    this.pgtIou = StringSupport.trimOrNull(pgtIou);
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:4,代码来源:TicketValidationResponse.java

示例10: setScopeDelimiter

import net.shibboleth.utilities.java.support.primitive.StringSupport; //导入方法依赖的package包/类
/**
 * Set the scope delimiter.
 * 
 * @param newScopeDelimiter
 *            delimiter to set
 */
public void setScopeDelimiter(@Nullable final String newScopeDelimiter) {
    ComponentSupport.ifInitializedThrowUnmodifiabledComponentException(this);
    scopeDelimiter = StringSupport.trimOrNull(newScopeDelimiter);
}
 
开发者ID:CSCfi,项目名称:shibboleth-idp-oidc-extension,代码行数:11,代码来源:OIDCScopedStringAttributeEncoder.java

示例11: setGroup

import net.shibboleth.utilities.java.support.primitive.StringSupport; //导入方法依赖的package包/类
/**
 * Sets the group name.
 *
 * @param group Group name.
 */
public void setGroup(@NotEmpty final String group) {
    this.group = StringSupport.trimOrNull(group);
}
 
开发者ID:serac,项目名称:shibboleth-idp-ext-cas,代码行数:9,代码来源:ServiceDefinition.java


注:本文中的net.shibboleth.utilities.java.support.primitive.StringSupport.trimOrNull方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。