Example usage for org.apache.commons.lang StringUtils isBlank

List of usage examples for org.apache.commons.lang StringUtils isBlank

Introduction

In this page you can find the example usage for org.apache.commons.lang StringUtils isBlank.

Prototype

public static boolean isBlank(String str) 

Source Link

Document

Checks if a String is whitespace, empty ("") or null.

Usage

From source file:biz.netcentric.cq.tools.actool.helper.InitialContentHelper.java

static boolean createInitialContent(final Session session, final AcInstallationHistoryPojo history, String path,
        Set<AceBean> aceBeanSetFromConfig)
        throws RepositoryException, PathNotFoundException, ItemExistsException, ConstraintViolationException,
        VersionException, InvalidSerializedDataException, LockException, AccessDeniedException {

    String initialContent = findInitialContentInConfigsForPath(aceBeanSetFromConfig, history);
    if (StringUtils.isBlank(initialContent)) {
        return false;
    } else {/*w w w  . j av  a  2 s  .c om*/
        boolean success = createPathWithInitialContent(session, path, initialContent, history);
        return success;
    }
}

From source file:com.googlecode.jtiger.modules.ecside.util.ExportViewUtils.java

public static String parsePDF(String value) {
    if (StringUtils.isBlank(value))
        return "";

    value = replaceNonBreakingSpaces(value);
    value = escapeChars(value);// www  .  j ava  2s. c om

    return value;
}

From source file:net.sourceforge.fenixedu.presentationTier.servlets.filters.FenixOAuthToken.java

public static FenixOAuthToken parse(String oAuthToken) throws FenixOAuthTokenException {

    if (StringUtils.isBlank(oAuthToken)) {
        throw new FenixOAuthTokenException();
    }//from   w w w  .j  av  a 2  s.c  o  m

    String accessTokenDecoded = new String(Base64.getDecoder().decode(oAuthToken));
    String[] accessTokenBuilder = accessTokenDecoded.split(":");

    if (accessTokenBuilder.length != 2) {
        throw new FenixOAuthTokenException();
    }

    String appUserSessionExternalId = accessTokenBuilder[0];
    String accessToken = accessTokenBuilder[1];

    LOGGER.info("AccessToken: {}", accessTokenDecoded);
    LOGGER.info("[0] AppUserSesson ID: {}", appUserSessionExternalId);
    LOGGER.info("[1] Random: {}", accessTokenBuilder[1]);

    AppUserSession appUserSession = appUserSession(appUserSessionExternalId);

    if (appUserSession == null || !appUserSession.isActive()) {
        throw new FenixOAuthTokenException();
    }

    return new FenixOAuthToken(appUserSession, accessToken);
}

From source file:com.edmunds.common.configuration.dns.DNSLegacyUtil.java

/**
 * Takes a legacy environment name and converts it to the current environment name.
 *
 * @param environmentName the legacy environment name.
 * @return the new environment name.//from w w  w .ja v  a  2  s . c o m
 */
static String getActualEnvironmentName(String environmentName) {
    if (environmentName == null) {
        return null;
    }

    if (StringUtils.isBlank(environmentName)) {
        return "";
    }

    environmentName = environmentName.toLowerCase();

    if (LEGACY_PRODUCTION_ENVIRONMENT_NAME.equals(environmentName)) {
        environmentName = PRODUCTION_ENVIRONMENT_NAME;
    }

    return environmentName;
}

From source file:edu.northwestern.bioinformatics.studycalendar.restlets.FormParameters.java

public String extractFirstFrom(Form form) {
    String value = form.getFirstValue(attributeName());
    return StringUtils.isBlank(value) ? null : value;
}

From source file:com.suryadisoft.exception.Validator.java

public void validateName(String firstName, String lastName) {
    if (StringUtils.isBlank(firstName)) {
        throw new ValidationException(TestError.INVALID_NAME, new Object[] { "First" }, new Response());
    } else if (StringUtils.isBlank(lastName)) {
        throw new ValidationException(TestError.INVALID_NAME, new Object[] { "Last" }, new Response());
    }//from w w w. j  av a 2  s. c  o  m
}

From source file:net.sf.spindle.core.scanning.BuiltInBindingType.java

/**
 * Templates have default type of {@link #LITERAL}<br>
 * XML has the default type of {@link #EXPRESSION}
 * /* w w w. ja va  2  s.  c  o  m*/
 * @param identifier
 *            the string part before the colon
 * @param defaultBindingType
 *            the binding type to return if the idenifier is null or an empty string
 * @return the type that corresponds to the identifier, or the default, or {@link #UNKNOWN}
 */
public static BuiltInBindingType get(String identifier, BuiltInBindingType defaultBindingType) {
    if (StringUtils.isBlank(identifier))
        return defaultBindingType;

    for (BuiltInBindingType type : values()) {
        if (identifier.equals(type.identifier))
            return type;
    }
    return UNKNOWN;
}

From source file:com.ewcms.publication.freemarker.directive.page.SkipPageLast.java

@Override
public PageOut skip(Integer count, Integer number, String label, UriRuleable rule) throws TemplateException {

    label = StringUtils.isBlank(label) ? DEFAULT_LABEL : label;
    int last = count - 1;
    boolean active = (number != last);
    GeneratorUrl generatorUrl = new GeneratorUrl(rule, number);
    String url = generatorUrl.getUriValue(last);

    return new PageOut(count, last, label, url, active);
}

From source file:com.ewcms.publication.freemarker.directive.page.SkipPageFirst.java

@Override
public PageOut skip(Integer count, Integer number, String label, UriRuleable rule) throws TemplateException {

    label = StringUtils.isBlank(label) ? DEFAULT_LABEL : label;
    int first = 0;
    boolean active = (number != first);
    GeneratorUrl generatorUrl = new GeneratorUrl(rule, number);
    String url = generatorUrl.getUriValue(first);

    return new PageOut(count, first, label, url, active);
}

From source file:com.smartitengineering.util.bean.BeanFactoryRegistrar.java

public static void registerBeanFactory(final String beanFactoryContextName, final BeanFactory beanFactory) {
    if (beanFactory == null || StringUtils.isBlank(beanFactoryContextName)) {
        throw new IllegalArgumentException();
    }/*from   ww  w . j a  v  a2s. c  o m*/
    synchronized (beanFactories) {
        beanFactories.put(beanFactoryContextName, beanFactory);
    }
}