Example usage for org.apache.commons.lang3 StringUtils isNotBlank

List of usage examples for org.apache.commons.lang3 StringUtils isNotBlank

Introduction

In this page you can find the example usage for org.apache.commons.lang3 StringUtils isNotBlank.

Prototype

public static boolean isNotBlank(final CharSequence cs) 

Source Link

Document

Checks if a CharSequence is not empty (""), not null and not whitespace only.

 StringUtils.isNotBlank(null)      = false StringUtils.isNotBlank("")        = false StringUtils.isNotBlank(" ")       = false StringUtils.isNotBlank("bob")     = true StringUtils.isNotBlank("  bob  ") = true 

Usage

From source file:com.autonomy.nonaci.indexing.impl.DreAddCommand.java

@Override
public String getQueryString() {
    try {//ww  w. jav a 2s  .c  om
        // Get the query string comprising of all the other parameters...
        final String queryString = super.getQueryString();

        return StringUtils.isNotBlank(queryString) ? urlCodec.encode(indexFile, "UTF-8") + '&' + queryString
                : urlCodec.encode(indexFile, "UTF-8");
    } catch (final UnsupportedEncodingException uee) {
        throw new IndexingException(uee);
    }
}

From source file:com.esofthead.mycollab.vaadin.ui.form.field.LinkViewField.java

@Override
protected Component initContent() {
    if (StringUtils.isNotBlank(value)) {
        final LabelLink l = new LabelLink(value, href);
        if (iconResourceLink != null) {
            l.setIconLink(iconResourceLink);
        }/*from   w w w.  j a v  a 2 s . c  om*/
        l.setWidth("100%");
        return l;
    } else {
        final Label l = new Label(" ", ContentMode.HTML);
        l.setWidth("100%");
        return l;
    }
}

From source file:de.micromata.genome.logging.config.LoggingWithFallbackLocalSettingsConfigModel.java

@Override
public void fromLocalSettings(LocalSettings localSettings) {
    super.fromLocalSettings(localSettings);
    String fallbackId = localSettings.get(buildKey("fallback.typeId"));
    if (StringUtils.isNotBlank(fallbackId) == true) {
        fallbackConfig = new LsLoggingLocalSettingsConfigModel(getKeyPrefix() + "fallback.");
        fallbackConfig.fromLocalSettings(localSettings);
    }/*  w  w w. j  av a2s . co m*/
}

From source file:com.tdclighthouse.prototype.components.catalogs.ContentCatalog.java

@Override
public Map<String, Object> getModel(HstRequest request, HstResponse response) {
    Map<String, Object> model = new HashMap<String, Object>();

    ContentCatalogInfo parametersInfo = (ContentCatalogInfo) getComponentParametersInfo(request);
    model.put("parameterInfo", parametersInfo);

    if (parametersInfo != null && StringUtils.isNotBlank(parametersInfo.getTemplate())) {
        response.setRenderPath("jcr:" + parametersInfo.getTemplate());
    }/*www .  j  a v a 2s  .c  om*/

    HippoBean contentBean = request.getRequestContext().getContentBean();
    if (contentBean != null) {
        model.put(Constants.AttributesConstants.DOCUMENT, contentBean);
    }

    return model;
}

From source file:com.threewks.thundr.bigmetrics.admin.Report.java

@Override
public String toString() {
    return String.format("%s%s - '%s'", name, StringUtils.isNotBlank(event) ? " (" + event + ")" : "",
            template);/*from w w  w . java2 s .c o  m*/
}

From source file:de.blizzy.documentr.markdown.macro.impl.TabMacro.java

static List<TabData> getTabs(String s) {
    String[] parts = StringUtils.splitByWholeSeparator(s, TAB_START_MARKER);
    List<TabData> tabs = Lists.newArrayList();
    for (String part : parts) {
        part = StringUtils.removeEnd(part, TAB_END_MARKER);
        if (StringUtils.isNotBlank(part)) {
            TabData tabData = TabData.deserialize(part);
            tabs.add(tabData);//from  w  w w .jav a2s  .com
        }
    }
    return tabs;
}

From source file:car_counter.storage.sqlite.SqliteStorage.java

public SqliteStorage(Wini ini) {
    try {// w w w . ja  v a  2  s  .  co m
        Class.forName("org.sqlite.JDBC");
    } catch (Exception e) {
        throw new IllegalStateException("Error loading sqlite driver.", e);
    }

    try {
        String database = ini.get("Storage", "database", String.class);
        Preconditions.checkState(StringUtils.isNotBlank(database), "A database file is required");
        Path dbFile = Paths.get(database);

        connection = DriverManager.getConnection(String.format("jdbc:sqlite:%s", dbFile.toAbsolutePath()));

        initialiseTables();
    } catch (SQLException e) {
        throw new IllegalStateException("Error opening database", e);
    }
}

From source file:edu.usu.sdl.openstorefront.web.init.AngularRewriteRule.java

@Override
public RewriteMatch matches(HttpServletRequest request, HttpServletResponse response) {
    String actionPath = request.getRequestURI().replace(request.getContextPath() + "/", "");
    if (StringUtils.isNotBlank(actionPath)) {
        if (actionPath.contains("/") == false) {
            if (actionPath.contains(".") == false) {
                return new AngularRewriteMatch();
            }//w  ww  . j  av a2  s .co  m
        }
    }
    return null;
}

From source file:de.micromata.genome.jpa.Clauses.java

/**
 * Equal. Handles <code>is null</code>, too.
 *
 * @param column the column//  w  w w .  j  a  v a2  s.com
 * @param value the value
 * @return the op clause
 */
public static OpClause equal(final String column, final Object value) {
    return new OpClause("=", column, value) {
        @Override
        public void renderClause(StringBuilder sb, String masterEntityName, Map<String, Object> args) {
            if (value != null) {
                super.renderClause(sb, masterEntityName, args);
            } else {
                if (StringUtils.isNotBlank(masterEntityName) == true) {
                    sb.append(masterEntityName).append('.');
                }
                sb.append(column).append(" is null");
            }
        }
    };
}

From source file:com.meltmedia.cadmium.deployer.DeploymentCheckCommandAction.java

@Override
public boolean execute(CommandContext<DeploymentCheckRequest> ctx) throws Exception {
    if (StringUtils.isNotBlank(ctx.getMessage().getBody().getWarName())) {
        logger.debug("Checking deployment state.");
        String warName = ctx.getMessage().getBody().getWarName();
        DeploymentCheckResponse deploymentResponse = new DeploymentCheckResponse();
        deploymentResponse.setStarted(true);
        try {/* w  w w  . j ava2  s.c  o m*/
            boolean deployed = jbossUtil.isWarDeployed(warName);
            logger.info("{} deployment state: {}", warName, deployed);
            deploymentResponse.setFinished(deployed);
        } catch (NoDeploymentFoundException e) {
            logger.info("No deployment has started yet.");
            deploymentResponse.setStarted(false);
        } catch (Throwable e) {
            logger.error("Failed to deploy " + warName, e);
            deploymentResponse.setError(e);
        }
        Message<DeploymentCheckResponse> response = new Message<DeploymentCheckResponse>(
                DeploymentCheckResponseCommandAction.COMMAND_ACTION, deploymentResponse);
        sender.sendMessage(response, null);
    }
    return true;
}