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:jp.co.opentone.bsol.linkbinder.util.AttachmentUtilTest.java

private void cleanup() {
    if (StringUtils.isNotEmpty(fileName)) {
        File f = new File(fileName);
        if (f.exists()) {
            f.delete();//from  w ww  .  j a v a 2  s .  co m
        }
    }
}

From source file:com.bstek.dorado.view.config.definition.AssembledComponentExpressionObject.java

public String id(String id) {
    String realId = idMap.get(id);
    if (StringUtils.isNotEmpty(realId)) {
        return realId;
    }//from  www. j  a v a 2s.c o m

    Context context = Context.getCurrent();
    Integer maxId = (Integer) context.getAttribute(Context.THREAD, MAX_ID_KEY);
    int sn = 0;
    if (maxId != null) {
        sn = maxId.intValue();
    }
    sn++;
    realId = id + '_' + sn;
    context.setAttribute(Context.THREAD, MAX_ID_KEY, new Integer(sn));
    idMap.put(id, realId);
    return realId;
}

From source file:com.jaspersoft.jasperserver.war.cascade.handlers.converters.IntegerDataConverter.java

@Override
public Integer stringToValue(String rawData) {
    return StringUtils.isNotEmpty(rawData) ? Integer.valueOf(rawData) : null;
}

From source file:com.netflix.spinnaker.halyard.deploy.spinnaker.v1.profile.IAPConfig.java

public IAPConfig(Security security) {
    if (!security.getAuthn().getIap().isEnabled()) {
        return;//from ww  w . ja  va  2s . co  m
    }

    IAP iap = security.getAuthn().getIap();

    this.enabled = iap.isEnabled();
    if (StringUtils.isNotEmpty(iap.getAudience())) {
        this.audience = iap.getAudience();
    }
    if (StringUtils.isNotEmpty(iap.getJwtHeader())) {
        this.jwtHeader = iap.getJwtHeader();
    }
    if (StringUtils.isNotEmpty(iap.getIssuerId())) {
        this.issuerId = iap.getIssuerId();
    }
    if (StringUtils.isNotEmpty(iap.getIapVerifyKeyUrl())) {
        this.iapVerifyKeyUrl = iap.getIapVerifyKeyUrl();
    }
}

From source file:mp.platform.cyclone.webservices.utils.server.CurrencyHelper.java

/**
 * Given a currency symbol or identifier as string, returns the {@link Currency} instance
 *//*from  w  w  w.  j  ava2  s .  com*/
public Currency resolve(final String string) {
    if (StringUtils.isNotEmpty(string)) {
        return currencyService.loadBySymbolOrId(string);
    }
    return null;
}

From source file:com.cnd.greencube.web.base.interceptor.ListInterceptor.java

@Override
public void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,
        ModelAndView modelAndView) throws Exception {
    if (modelAndView != null && modelAndView.isReference()) {
        String viewName = modelAndView.getViewName();
        if (StringUtils.startsWith(viewName, REDIRECT_VIEW_NAME_PREFIX)) {
            String listQuery = WebUtils.getCookie(request, LIST_QUERY_COOKIE_NAME);
            if (StringUtils.isNotEmpty(listQuery)) {
                if (StringUtils.startsWith(listQuery, "?")) {
                    listQuery = listQuery.substring(1);
                }/*  w w w.  ja v a2 s .  c  om*/
                if (StringUtils.contains(viewName, "?")) {
                    modelAndView.setViewName(viewName + "&" + listQuery);
                } else {
                    modelAndView.setViewName(viewName + "?" + listQuery);
                }
            }
        }
    }
}

From source file:com.jfaker.framework.security.model.Org.java

public Page<Org> paginate(int pageNumber, int pageSize, String name) {
    String sql = "from sec_org o left join sec_org op on o.parent_org=op.id ";
    if (StringUtils.isNotEmpty(name)) {
        sql += " where o.name like '%" + name + "%' ";
    }/*from   www . j av a  2s.c  o m*/
    sql += " order by id desc";
    return paginate(pageNumber, pageSize, "select o.*,op.name as parentName", sql);
}

From source file:com.stratumsoft.xmlgen.SchemaUtil.java

/**
 * Get an instance of {@link XmlSchemaCollection} and read the given schema into it.
 *
 * @param schemaFilePath fully-qualified path to the schema file
 * @param baseUri        base uri to use to resolve any imports/includes; if not specified, the schemaFilePath
 *                       param will be used
 * @return//from   ww w.  j  a  v  a 2 s.c  om
 * @throws java.io.FileNotFoundException if the input path does not resolve to an actual file on disk
 */
public static XmlSchemaCollection getSchemaCollection(String schemaFilePath, String baseUri)
        throws FileNotFoundException {
    XmlSchemaCollection schColl = null;
    if (StringUtils.isNotEmpty(schemaFilePath)) {
        final File schFile = new File(schemaFilePath);
        final FileReader reader = new FileReader(schFile);

        schColl = new XmlSchemaCollection();
        schColl.setBaseUri(StringUtils.isNotEmpty(baseUri) ? baseUri : schemaFilePath);
        schColl.setSchemaResolver(new DefaultURIResolver());

        schColl.read(reader);
    }
    return schColl;
}

From source file:com.ruzhi.demo.lifeserverweb.StringUtil.java

/**
 * ??/*from  w  w w .j  a  v  a 2  s.c om*/
 *
 * @param s
 * @return s""
 */
public static String getStrOnlyNumOrLetter(String s) {
    String str = "";
    if (StringUtils.isNotEmpty(s)) {
        Pattern p = Pattern.compile("[a-zA-Z0-9]*");
        Matcher m = p.matcher(s);
        while (m.find()) {
            str += m.group();
        }
    }
    return str;
}

From source file:net.duckling.ddl.web.api.APIBaseResourceController.java

protected String getResourceType(Resource resource) {
    String type = "default";
    if (resource != null) {
        if (!resource.isFile()) {
            type = resource.getItemType();
        } else {//from w  ww  .  j av a 2  s  .com
            type = resource.getFileType();
        }
    }
    if (!StringUtils.isNotEmpty(type))
        type = "default";
    return type;
}