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

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

Introduction

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

Prototype

public static boolean isNotBlank(String str) 

Source Link

Document

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

Usage

From source file:com.tdclighthouse.prototype.services.FolderCreationService.java

public String generateFolders(String parentPath, String relPath, NewFolderCallBackFactory factory)
        throws RepositoryException {
    Node node = documentManager.getNode(parentPath);
    String[] nodes = relPath.split("/");
    for (String nodePath : nodes) {
        if (StringUtils.isNotBlank(nodePath)) {
            String cleansedPath = Text.escapeIllegalJcrChars(nodePath);
            if (node.hasNode(cleansedPath)) {
                node = node.getNode(cleansedPath);
            } else {
                String path = documentManager
                        .runInSession(factory.getNewFolderCallBack(node.getPath(), cleansedPath));
                node = documentManager.getNode(path);
            }/*w w w  .j  a  v  a 2  s  .c o m*/
        }
    }
    return node.getPath();
}

From source file:gobblin.util.AzkabanTags.java

/**
 * Gets all useful Azkaban runtime properties required by metrics as a {@link Map}.
 *
 * @param conf Hadoop Configuration that contains the properties. Keys of {@link #PROPERTIES_TO_TAGS_MAP} lists out
 * all the properties to look for in {@link Configuration}.
 *
 * @return a {@link Map} with keys as property names (name mapping in {@link #PROPERTIES_TO_TAGS_MAP}) and the value
 * of the property from {@link Configuration}
 *//*from   www.j a  v  a2  s. com*/
public static Map<String, String> getAzkabanTags(Configuration conf) {
    Map<String, String> tagMap = Maps.newHashMap();

    for (Map.Entry<String, String> entry : PROPERTIES_TO_TAGS_MAP.entrySet()) {
        if (StringUtils.isNotBlank(conf.get(entry.getKey()))) {
            tagMap.put(entry.getValue(), conf.get(entry.getKey()));
        } else {
            log.warn(String.format("No config value found for config %s. Metrics will not have tag %s",
                    entry.getKey(), entry.getValue()));
        }
    }
    return tagMap;
}

From source file:com.rsmart.kuali.kfs.fp.businessobject.BatchDisbursementVoucherWireTransfer.java

/**
 * Takes a <code>String</code> and attempt to format as <code>Boolean</code> for setting the
 * disbursementVoucherWireTransferFeeWaiverIndicator field
 * //w ww  .j av a2 s.  c  om
 * @param disbursementVoucherWireTransferFeeWaiverIndicator as string
 */
public void setDisbursementVoucherWireTransferFeeWaiverIndicator(
        String disbursementVoucherWireTransferFeeWaiverIndicator) {
    if (StringUtils.isNotBlank(disbursementVoucherWireTransferFeeWaiverIndicator)) {
        Boolean disbursementVoucherWireTransferFeeWaiver = (Boolean) (new BooleanFormatter())
                .convertFromPresentationFormat(disbursementVoucherWireTransferFeeWaiverIndicator);
        super.setWireTransferFeeWaiverIndicator(disbursementVoucherWireTransferFeeWaiver);
    }
}

From source file:com.pscnlab.member.daos.impls.MemberDaoImpl.java

@Override
public Page<Member> findPage(MemberPageQueryDTO query, Integer offset, Integer size) {
    FilterMap filterMap = new FilterMap();
    if (query != null) {
        if (query.getUuidRole() != null) {
            filterMap.eq("uuidRole", query.getUuidRole());
        }/*from www.j  a va  2s  .  c  om*/
        if (StringUtils.isNotBlank(query.getGender())) {
            filterMap.eq("gender", query.getGender());
        }
        if (StringUtils.isNotEmpty(query.getName())) {
            filterMap.like("name", "%" + query.getName() + "%");
        }
        if (StringUtils.isNotEmpty(query.getTelephone())) {
            filterMap.like("telephone", "%" + query.getTelephone() + "%");
        }
    }
    return super.page(filterMap, offset, size);
}

From source file:com.openshift.internal.restclient.okhttp.BasicChallangeHandler.java

@Override
public Builder handleChallange(Builder builder) {
    StringBuilder value = new StringBuilder();
    if (StringUtils.isNotBlank(context.getUserName())) {
        value.append(context.getUserName()).append(":");
    }//from w w w . j a va 2s .co m
    if (StringUtils.isNotBlank(context.getPassword())) {
        value.append(context.getPassword());
    }
    return builder.header(OpenShiftAuthenticator.PROPERTY_AUTHORIZATION,
            IHttpConstants.AUTHORIZATION_BASIC + " " + Base64Coder.encode(value.toString()));
}

From source file:com.dattack.dbtools.drules.engine.DefaultNotificationActionBeanVisitor.java

private static Template createTemplate(final NotificationActionSendMailBean bean)
        throws ConfigurationException, IOException {

    if (StringUtils.isNotBlank(bean.getMessageTemplateText())) {
        return TemplateHelper.createTemplate(bean.getMessageTemplateText());
    }//from w  w  w .  j a v a 2s.c o  m

    if (StringUtils.isNotBlank(bean.getMessageTemplateFile())) {
        return TemplateHelper.loadTemplate(bean.getMessageTemplateFile());
    }

    // use default template
    return TemplateHelper
            .loadTemplate(GlobalConfiguration.getProperty(GlobalConfiguration.DRULES_TEMPLATE_EMAIL_KEY));
}

From source file:ips1ap101.lib.core.jsf.component.Pestanya.java

/**
 * {@inheritDoc}//from  w w w .  jav a  2s  .  co m
 */
@Override
public String getToolTip() {
    String superstr = super.getToolTip();
    if (StringUtils.isNotBlank(superstr) && getValueExpression("toolTip") == null) {
        if (superstr.startsWith("BundleDominios.")) {
            int i = superstr.indexOf('.');
            String key = superstr.substring(i + 1).trim();
            if (key.length() > 0) {
                return BundleDominios.getToolTip(key);
            }
        }
    }
    return superstr;
}

From source file:com.oa.manager.administration.service.impl.AccidentServiceImpl.java

/**
 * /*w w  w  .ja  v a2 s .  c  om*/
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public DataGrid loadaccident(VmAccident vd, PageParam param) {
    DataGrid data = new DataGrid();
    StringBuffer sb = new StringBuffer(
            " from VmAccident vd,VmDrivertable vt,VmVehiclemanagement vg where vd.drivingno=vt.id and vg.id=vd.licenseno ");
    List list = new ArrayList();

    if (StringUtils.isNotBlank(vd.getLicenseno())) {
        sb.append(" and vg.licenseno = ? ");
        list.add(vd.getLicenseno());

    }
    if (StringUtils.isNotBlank(vd.getDrivingno())) {
        sb.append(" and vt.drivingname = ?");
        list.add(vd.getDrivingno());
    }
    if (vd.getStartDate() != null) {
        sb.append(" and vd.createdate>=?");
        list.add(vd.getStartDate());
    }
    if (vd.getEndDate() != null) {
        sb.append(" and vd.createdate<=?");
        list.add(vd.getEndDate());
    }
    data.setTotal((Long) dao.findOne("select count(*)" + sb.toString(), list));
    if (StringUtils.isNotBlank(param.getSort())) {
        param.appendOrderBy(sb);//?
    } else {

        sb.append(" order by vd.createdate desc ");
    }

    List<Map<String, Object>> rows = dao.findPage(
            "select new Map( vd.id as id,vd.happenplace as happenplace, vd.accidentconfirm as accidentconfirm,vd.summary as summary,vd.createdate as createdate,vt.drivingname as drivingname,vg.licenseno as licenseno,vg.id as licensenoId,vd.drivingno as drivingno) "
                    + sb.toString(),
            param.getPage(), param.getRows(), list);

    data.setRows(rows);

    return data;
}

From source file:com.linkedin.pinot.controller.api.restlet.resources.PinotControllerHealthCheck.java

@Override
public Representation get() {
    Representation presentation = null;//from  w  w w .j a v  a2 s . co  m
    if (StringUtils.isNotBlank(vip)) {
        presentation = new StringRepresentation("GOOD");
    }
    return presentation;
}

From source file:gov.utah.health.uper.service.PatientServiceImpl.java

@Override
public PatientBean savePatient(PatientBean bean) {

    Patient pt = patientRepository.findOne(bean.getPatientId());

    if (null == pt) {
        pt = new Patient();
        pt.setAddedUserId(securityService.getUserName());
        pt.setCreatedDate(new Date());
    }//from www .  j  av a 2s  .  co  m
    pt.setUpdatedUserId(securityService.getUserName());
    pt.setLicenseExpireDate(utilityService.formatDate(bean.getLicenseExpireDate()));
    pt.setParentAddress(bean.getParentAddressCurrent());
    pt.setParentCity(bean.getParentCityCurrent());
    if (StringUtils.isNotBlank(bean.getParentDob())) {
        pt.setParentDob(utilityService.formatDate(bean.getParentDob()));
    }
    pt.setParentFirstName(bean.getParentFirstName());
    pt.setParentLastName(bean.getParentLastName());
    pt.setParentMiddleName(bean.getParentMiddleName());
    pt.setParentState(bean.getParentStateCurrent());
    pt.setParentZip(bean.getParentZipCurrent());

    pt.setPatientAddress(bean.getAddressCurrent());
    pt.setPatientCity(bean.getCityCurrent());
    pt.setPatientDob(utilityService.formatDate(bean.getDob()));
    pt.setPatientFirstName(bean.getFirstName());
    pt.setPatientLastName(bean.getLastName());
    pt.setPatientMiddleName(bean.getMiddleName());
    pt.setPatientState(bean.getStateCurrent());
    pt.setPatientZip(bean.getZipCurrent());

    pt.setPhysicianName(bean.getPhysicianName());
    pt.setPhysicianBoardCertified(bean.isPhysicianBoardCertified());
    if (null != bean.getDoplNumber()) {
        pt.setDoplNumber(bean.getDoplNumber());
    }

    pt = patientRepository.save(pt);
    bean.setPatientId(pt.getId());
    return bean;

}