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

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

Introduction

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

Prototype

public static boolean isNotEmpty(String str) 

Source Link

Document

Checks if a String is not empty ("") and not null.

Usage

From source file:com.bstek.dorado.idesupport.initializer.FloatControlRuleTemplateInitializer.java

public void initRuleTemplate(RuleTemplate ruleTemplate, InitializerContext initializerContext)
        throws Exception {
    String typeName = ruleTemplate.getType();
    if (StringUtils.isNotEmpty(typeName)) {
        Class<?> type = ClassUtils.forName(typeName);
        if (type.equals(FloatControl.class) || Modifier.isAbstract(type.getModifiers())) {
            return;
        }/*from  w  w w. j ava 2 s  .c o  m*/

        boolean found = false;
        for (Class<?> _interface : type.getInterfaces()) {
            if (_interface.equals(FloatControl.class)) {
                found = true;
                break;
            }
        }
        if (!found) {
            return;
        }
    }

    RuleTemplateManager ruleTemplateManager = initializerContext.getRuleTemplateManager();
    RuleTemplate floatControlRule = ruleTemplateManager.getRuleTemplate("FloatControl");
    if (floatControlRule == null) {
        floatControlRule = new AutoRuleTemplate("FloatControl", FloatControl.class.getName());
        floatControlRule.setAbstract(true);
        ruleTemplateManager.addRuleTemplate(floatControlRule);
    }

    RuleTemplate[] parents = ruleTemplate.getParents();
    if (parents != null) {
        RuleTemplate[] oldParents = parents;
        parents = new RuleTemplate[oldParents.length + 1];
        System.arraycopy(oldParents, 0, parents, 0, oldParents.length);
        parents[oldParents.length] = floatControlRule;
    } else {
        parents = new RuleTemplate[] { floatControlRule };
    }
    ruleTemplate.setParents(parents);
}

From source file:co.cask.cdap.client.rest.TestUtils.java

public static String getStreamNameFromUri(String uri) {
    String streamName = StringUtils.EMPTY;
    if (StringUtils.isNotEmpty(uri)) {
        Pattern p = Pattern.compile("streams/.*?/");
        Matcher m = p.matcher(uri);
        if (m.find()) {
            String b = m.group();
            streamName = b.substring(b.indexOf("/") + 1, b.length() - 1);
        }/*from  w  w w  .  j ava  2 s  .  c  o m*/
    }
    return streamName;
}

From source file:fr.hoteia.qalingo.web.mvc.viewbean.AbstractViewBean.java

/**
 * /*from   w  w w .  j  a  v  a 2  s . co  m*/
 */
protected String encodeQuote(String value) {
    if (StringUtils.isNotEmpty(value)) {
        value = value.replace("\"", "&quot;");
    }
    return value;
}

From source file:de.pawlidi.openaletheia.utils.PropertiesUtils.java

public static void setStringProperty(Properties properties, final String key, final String value) {
    if (StringUtils.isNotEmpty(value)) {
        properties.setProperty(key, value);
    }//from  w ww.  ja v  a  2  s  .  c o m
}

From source file:com.npower.dm.util.BeanHelper.java

/**
 * private/protected//w w w. j ava2 s . co m
 */
static public Object getDeclaredProperty(Object object, String propertyName)
        throws IllegalAccessException, NoSuchFieldException {
    assert object != null;
    assert StringUtils.isNotEmpty(propertyName);
    Field field = object.getClass().getDeclaredField(propertyName);
    return getDeclaredProperty(object, field);
}

From source file:com.pureinfo.srm.view.function.ShowDupTagCheckBoxFunctionHandler.java

public Object perform(Object[] _args, IDVContext _context) throws PureException {
    Object[] arrObj = new Object[2];
    String sFormal = (String) _args[0];

    System.out.println("<<<<<<<<<<<<<<<<<<<<<" + sFormal);
    IProductMgr mgr = (IProductMgr) ArkContentHelper.getContentMgrOf(SRMTypes.PRODUCT);
    boolean isFormal = StringUtils.isNotEmpty(sFormal)
            ? (sFormal.equalsIgnoreCase("true") ? Boolean.TRUE.booleanValue() : Boolean.FALSE.booleanValue())
            : false;/*  ww w  .  j ava 2  s .c om*/
    System.out.println(">>>>>>>>>>>>>>>>>>>>>" + isFormal);
    arrObj = mgr.renderTableOfDupTagCheckBox(isFormal);

    return arrObj[0].toString();
}

From source file:io.kahu.hawaii.util.logger.Log4jConfigListener.java

@Override
public void contextInitialized(ServletContextEvent sce) {
    String config = System.getenv("log4j.configuration");
    if (StringUtils.isBlank(config)) {
        config = System.getProperty("log4j.configuration");
    }//from   w  ww.j a  v  a  2  s.c o m
    if (StringUtils.isNotEmpty(config)) {
        String overrideConfig = StringUtils.replace(config, ".xml", ".local.xml");
        if (!configureAndWatch(overrideConfig)) {
            configureAndWatch(config);
            sce.getServletContext().log("Configured to watch log configuration '" + config + "'");
        } else {
            sce.getServletContext().log("Configured to watch log configuration '" + overrideConfig + "'");
        }
    }
}

From source file:com.qcloud.project.macaovehicle.service.impl.CarOwnerHousersServiceImpl.java

@Override
public boolean add(CarOwnerHousers carOwnerHousers) {

    long id = autoIdGenerator.get(ID_KEY);
    carOwnerHousers.setId(id);/*from  w  w w . ja v a2 s  .  com*/
    if (StringUtils.isNotEmpty(carOwnerHousers.getLicenseUrl())) {
        carOwnerHousers.setLicenseUrl(fileSDKClient.uidToUrl(carOwnerHousers.getLicenseUrl()));
    }
    return carOwnerHousersDao.add(carOwnerHousers);
}

From source file:com.microsoft.alm.plugin.external.commands.TfVersionCommand.java

@Override
public ToolVersion parseOutput(final String stdout, final String stderr) {
    throwIfError(stderr);//w  w w. j  a va2s  .  co m
    final String[] lines = getLines(stdout);
    for (final String line : lines) {
        if (StringUtils.isNotEmpty(line)) {
            final int start = line.toLowerCase().indexOf(VERSION_PREFIX);
            if (start >= 0) {
                return new ToolVersion(
                        StringUtils.removeEnd(line.substring(start + VERSION_PREFIX.length()), ")"));
            }
        }
    }

    return ToolVersion.UNKNOWN;
}

From source file:net.jforum.plugins.tagging.TopicExtension.java

@Extends(Actions.ADDSAVE)
public void afterSave(@Parameter(key = "tags") String tagString) {
    if (StringUtils.isNotEmpty(tagString)) {
        Topic topic = (Topic) this.propertyBag.get("topic");
        if (topic == null)
            return;

        tagService.addTag(tagString, topic);
    }// w  w w .  j a v  a  2 s  . c o  m
}