Example usage for org.apache.shiro.util StringUtils hasText

List of usage examples for org.apache.shiro.util StringUtils hasText

Introduction

In this page you can find the example usage for org.apache.shiro.util StringUtils hasText.

Prototype

public static boolean hasText(String str) 

Source Link

Document

Check whether the given String has actual text.

Usage

From source file:to.sauerkraut.krautadmin.core.crypto.ThreefishCipherService.java

License:Open Source License

@Override
protected String getTransformationString(final boolean streaming) {
    if (streaming) {
        throw new UnsupportedOperationException(
                "streaming-mode for Threefish cipher is currently not supported");
    }/*  www.j  a  va  2  s.c o  m*/

    final StringBuilder sb = new StringBuilder(getAlgorithmName());
    if (StringUtils.hasText(getModeName())) {
        sb.append(TRANSFORMATION_STRING_DELIMITER).append(getModeName());
    }
    if (StringUtils.hasText(getPaddingSchemeName())) {
        sb.append(TRANSFORMATION_STRING_DELIMITER).append(getPaddingSchemeName());
    }
    return sb.toString();
}

From source file:xyz.ivyxjc.HashedMatcher.java

License:Apache License

/**
 * Creates an instance using the specified {@link #getHashAlgorithmName() hashAlgorithmName} to hash submitted
 * credentials./*from w  w w . j  a v  a 2s . c  o m*/
 * @param hashAlgorithmName the {@code Hash} {@link org.apache.shiro.crypto.hash.Hash#getAlgorithmName() algorithmName}
 *                          to use when performing hashes for credentials matching.
 * @since 1.1
 */
public HashedMatcher(String hashAlgorithmName) {
    this();
    if (!StringUtils.hasText(hashAlgorithmName)) {
        throw new IllegalArgumentException("hashAlgorithmName cannot be null or empty.");
    }
    this.hashAlgorithm = hashAlgorithmName;
}