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.gst.infrastructure.core.api.ApiParameterHelper.java

public static Long commandId(final MultivaluedMap<String, String> queryParams) {
    Long id = null;//from ww w.  j  a  v a 2  s  .c o m
    if (queryParams.getFirst("commandId") != null) {
        final String value = queryParams.getFirst("commandId");
        if (StringUtils.isNotBlank(value)) {
            id = Long.valueOf(value);
        }
    }
    return id;
}

From source file:com.xx_dev.apn.proxy.utils.HostNamePortUtil.java

public static String getHostName(HttpRequest httpRequest) {
    String originalHostHeader = httpRequest.headers().get(HttpHeaders.Names.HOST);

    if (StringUtils.isBlank(originalHostHeader) && httpRequest.getMethod().equals(HttpMethod.CONNECT)) {
        originalHostHeader = httpRequest.getUri();
    }//from w w  w  .  ja va2s. c o m

    if (StringUtils.isNotBlank(originalHostHeader)) {
        String originalHost = StringUtils.split(originalHostHeader, ": ")[0];
        return originalHost;
    } else {
        String uriStr = httpRequest.getUri();
        try {
            URI uri = new URI(uriStr);

            String schema = uri.getScheme();

            String originalHost = uri.getHost();

            return originalHost;
        } catch (URISyntaxException e) {
            logger.error(e.getMessage(), e);
            return null;
        }
    }
}

From source file:com.sfs.whichdoctor.xml.writer.helper.SpecialtyXmlHelper.java

/**
 * Output the specialty collection as an XML string.
 *
 * @param specialties the specialties/*ww w  .  ja va 2  s  .  co  m*/
 *
 * @return the xml string
 */
public static String getSpecialtiesXml(final Collection<SpecialtyBean> specialties) {

    final XmlWriter xmlwriter = new XmlWriter();

    xmlwriter.writeEntity("specialties");

    for (SpecialtyBean specialty : specialties) {

        xmlwriter.writeEntity("specialty").writeAttribute("GUID", specialty.getGUID())
                .writeAttribute("specialtyId", specialty.getId());

        if (StringUtils.isNotBlank(specialty.getStatus())) {
            xmlwriter.writeEntity("status").writeText(specialty.getStatus()).endEntity();
        }
        if (StringUtils.isNotBlank(specialty.getTrainingOrganisation())) {
            xmlwriter.writeEntity("organisation").writeText(specialty.getTrainingOrganisation()).endEntity();
        }
        if (StringUtils.isNotBlank(specialty.getTrainingProgram())) {
            xmlwriter.writeEntity("program").writeText(specialty.getTrainingProgram()).endEntity();
        }
        if (specialty.getTrainingProgramYear() > 0) {
            xmlwriter.writeEntity("curriculumYear").writeText(specialty.getTrainingProgramYear()).endEntity();
        }

        xmlwriter.endEntity();
    }
    xmlwriter.endEntity();

    return xmlwriter.getXml();
}

From source file:com.googlecode.jtiger.modules.ecside.table.tool.ExtendTool.java

public static void buildExtendTool(HtmlBuilder html, TableModel model) {
    String extend = (String) model.getTable().getAttribute("ExtendTool");
    if (StringUtils.isNotBlank(extend)) {

        String width = model.getTable().getWidth();
        if (width.indexOf("px") == -1 && width.indexOf("%") == -1) {
            width = width + "px";
        }// w  ww  .j av  a2s.c o  m

        html.newline();

        html.div().styleClass("toolbar").style("width:" + width + ";").close();

        html.table(1).styleClass("toolbarTable").cellPadding("0").cellSpacing("0").close();
        html.tr(1).close();

        html.td(1).styleClass("extendTool").style("width:" + width + ";").close();
        html.append(extend);
        html.tdEnd();

        html.trEnd(1);
        html.tableEnd(1);
        html.divEnd();
    }
}

From source file:com.marvelution.hudson.plugins.apiv2.cache.activity.ActivityCachePredicates.java

public static Predicate<ActivityCache> relatesToJobs(final String[] jobnames) {
    List<Predicate<ActivityCache>> predicates = Lists.newArrayList();
    for (final String jobname : jobnames) {
        if (StringUtils.isNotBlank(jobname)) {
            predicates.add(relatesToJob(jobname));
        }//from   w ww. j  a  va2  s.c o m
    }
    return Predicates.or(predicates);
}

From source file:com.mmj.app.lucene.search.build.base.Param.java

public void setTitle(String title) {
    if (StringUtils.isNotBlank(title)) {
        this.title = title;
    }
}

From source file:com.hihsoft.baseclass.web.util.DateConverter.java

public DateConverter(String formatPattern) {
    if (StringUtils.isNotBlank(formatPattern)) {
        format = new SimpleDateFormat(formatPattern);
    }
}

From source file:de.thischwa.pmcms.server.ServletUtils.java

public static void establishContentType(String fileName, HttpServletResponse resp) {
    if (StringUtils.isBlank(fileName))
        return;/*w w w  . j a va2 s . c  om*/
    String contentType = contentTypes.getContentTypeFor(fileName);
    if (StringUtils.isNotBlank(contentType))
        resp.setContentType(contentType);
}

From source file:com.ultrapower.eoms.common.plugin.ecside.table.tool.ExtendTool.java

 public static void buildExtendTool(HtmlBuilder html,TableModel model) {
   String extend = (String) model.getTable()
         .getAttribute("ExtendTool");
   if (StringUtils.isNotBlank(extend)) {

      String width = model.getTable().getWidth();
      if (width.indexOf("px") == -1 && width.indexOf("%") == -1) {
         width = width + "px";
      }//www  .  j  av  a  2 s. c o  m

      html.newline();

      html.div().styleClass("toolbar").style("width:" + width + ";")
            .close();

      html.table(1).styleClass("toolbarTable").cellPadding("0")
            .cellSpacing("0").close();
      html.tr(1).close();

      html.td(1).styleClass("extendTool").style("width:" + width + ";")
            .close();
      html.append(extend);
      html.tdEnd();

      html.trEnd(1);
      html.tableEnd(1);
      html.divEnd();
   }
}

From source file:com.ultrapower.eoms.common.plugin.ecside.core.bean.Td.java

 public static String buildTd(Td tdBean,TableModel model){
   HtmlBuilder html=new HtmlBuilder();
   if (tdBean.getType()!=null && tdBean.getType().equalsIgnoreCase("blank")){
      return html.toString();
   }//from   ww w .ja va2s. c  o  m
   html.td(1);
   html.id(tdBean.getId());
   html.name(tdBean.getName());
   if (tdBean.getColspan()>1){
      html.colSpan(""+tdBean.getColspan());
   }
   if (tdBean.getRowspan()>1){
      html.rowSpan(""+tdBean.getRowspan());
   }
     if (StringUtils.isNotBlank(tdBean.getNowrap())){
        html.append(" nowrap=\""+tdBean.getNowrap()+"\" ");
     }
   html.style(tdBean.getStyle());
   html.styleClass(tdBean.getStyleClass());
   html.width(tdBean.getWidth());
   html.height(tdBean.getHeight());
   html.align(tdBean.getAlign());
   html.valign(tdBean.getValign());
   html.onclick(tdBean.getOnclick());
   html.ondblclick(tdBean.getOndblclick());
   html.onmouseover(tdBean.getOnmouseover());
   html.onmouseout(tdBean.getOnmouseout());
   html.tagAttributes(tdBean.getTagAttributes());
   html.close();
   html.append(tdBean.getContent());
   html.tdEnd();
   return html.toString();
}