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:hydrograph.ui.graph.model.components.SubjobComponent.java

@Override
public String getConverter() {
    String type = (String) this.getProperties().get(Constants.TYPE);
    if (StringUtils.isNotBlank(type)) {
        if (type.equalsIgnoreCase(Constants.INPUT))
            return "hydrograph.ui.engine.converter.impl.InputSubJobConverter";
        if (type.equalsIgnoreCase(Constants.OUTPUT))
            return "hydrograph.ui.engine.converter.impl.OutputSubJobConverter";
        if (type.equalsIgnoreCase(Constants.OPERATION))
            return "hydrograph.ui.engine.converter.impl.OperationSubJobConverter";

    }//from   www  .  ja  v a 2  s  .c  om
    return "hydrograph.ui.engine.converter.impl.CommandSubjobConverter";

}

From source file:net.di2e.ecdr.search.transform.atom.security.impl.SecurityConfigurationImpl.java

public void setConfigFormats(String newFormats) {
    if (StringUtils.isNotBlank(newFormats)) {
        formats = new HashSet<>((Arrays.asList(newFormats.split(","))));
    }/*from   w w  w  . j a v a  2 s  .c  om*/
}

From source file:bazaar4idea.command.BzrCatCommand.java

public String execute(BzrFile hgFile, BzrRevisionNumber vcsRevisionNumber, Charset charset) {
    List<String> arguments = new LinkedList<String>();
    if (vcsRevisionNumber != null && StringUtils.isNotBlank(vcsRevisionNumber.asString())) {
        arguments.add("-r");
        arguments.add(vcsRevisionNumber.asString());
    }/*from   w ww . j  ava 2s. com*/
    arguments.add(hgFile.getRelativePath());

    ShellCommandService service = ShellCommandService.getInstance(project);
    BzrStandardResult result = service.execute(hgFile.getRepo(), new BzrStandardResult(charset), "cat",
            arguments);
    return result.getStdOutAsString();
}

From source file:cd.go.contrib.elasticagents.docker.models.ExceptionMessage.java

private String initMessage(Throwable throwable) {
    if (StringUtils.isNotBlank(throwable.getMessage())) {
        return throwable.getMessage();
    }//from  w  w  w. ja v a2 s  .  com

    if (StringUtils.isNotBlank(this.stacktrace)) {
        return stacktrace.split("\n")[0];
    }

    return null;
}

From source file:com.timesheet.data.SearchImp.java

@Override
public List<Booking> searchResult(Search searchOb) {
    List<Booking> searchResult = new ArrayList<Booking>();

    System.out.println(" @@@@@@@@@@@@@@@@@@@@@@ :" + searchOb.getSearchProjectId() + " ,"
            + searchOb.getSearchFromDate() + "," + searchOb.getSearchUser());

    String searchSQL = utils.generatSearchSQL(searchOb);

    System.out.println("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ : Search SQL : " + searchSQL);

    if (StringUtils.isNotBlank(searchSQL)) {
        Query searchQuery = sessionFactory.getCurrentSession().createQuery(searchSQL);

        if (searchSQL.contains("userId")) {
            searchQuery.setInteger("userId", searchOb.getSearchUser());
        }// w  w w.  j a v  a2s.  co  m

        if (searchSQL.contains("projectId")) {
            searchQuery.setInteger("projectId", searchOb.getSearchProjectId());
        }

        if (searchSQL.contains("optionId")) {
            searchQuery.setInteger("optionId", searchOb.getSearchOptionId());
        }

        if (searchSQL.contains("startDate")) {
            Date startDate = utils.getFirstDateOfMonth(searchOb.getSearchMonth());

            searchQuery.setDate("startDate", startDate);
        }

        if (searchSQL.contains("endDate")) {
            Date endDate = utils.getLastDateOfMonth(searchOb.getSearchMonth());

            searchQuery.setDate("endDate", endDate);
        }

        if (searchSQL.contains("fromDate")) {
            searchQuery.setDate("fromDate", searchOb.getSearchFromDate());
        }

        if (searchSQL.contains("toDate")) {

            searchQuery.setDate("toDate", searchOb.getSearchToDate());
        }

        searchResult = searchQuery.list();
    }

    return searchResult;
    //throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}

From source file:edu.umd.cs.findbugs.detect.LpPreCompileRegCheck.java

@Override
public void visit(Code obj) {
    String methodName = getMethodName();
    // this.get/* w w w  .j  ava2s  .c  o  m*/
    // (springinitset)
    if (StringUtils.isNotBlank(methodName) && (!"<clinit>".equals(methodName) && !"<init>".equals(methodName)
            && !methodName.startsWith("init") && !methodName.startsWith("set"))) {
        isMethod = Boolean.TRUE;
        super.visit(obj);
    } else {
        isMethod = Boolean.FALSE;
        return;
    }
}

From source file:com.mosso.client.cloudfiles.sample.FilesRemove.java

private static void removeObject(String objectNameWithPath) throws HttpException, IOException, FilesException {
    if (!StringUtils.isNotBlank(objectNameWithPath)) {
        System.err.println("You must provide a valid value for the  Object name and path !");
        System.exit(0);/*from   w w w .jav  a2s.c  om*/
    } //if (!StringUtils.isNotBlank(ObjectNameWithPath))

    int firstSlashLocation = objectNameWithPath.indexOf('/');
    if (firstSlashLocation > -1) {
        String container = objectNameWithPath.substring(0, firstSlashLocation - 1);
        String object = objectNameWithPath.substring(firstSlashLocation + 1);
        FilesClient client = new FilesClient();
        if (client.login()) {
            client.deleteObject(container, object);
        } else {
            System.err.println("Failed to log in to Cloud FS");
            System.exit(-1);
        }
    } else {
        System.err.println("Please specify the object path in the form containerName/objectName");
        System.exit(-1);
    }
}

From source file:de.hybris.platform.acceleratorservices.util.HtmlElementHelper.java

public void writeOpenElement(final PageContext pageContext, final String elementName,
        final Map<String, String> attributes) {
    validateParameterNotNull(pageContext, "Parameter pageContext must not be null");
    validateParameterNotNull(elementName, "Parameter elementName must not be null");
    checkArgument(StringUtils.isNotBlank(elementName), "Parameter elementName must not be blank");

    final JspWriter out = pageContext.getOut();

    try {//ww  w  .j  a va  2s. c  om
        out.write("<" + elementName);
        if (attributes != null && !attributes.isEmpty()) {
            for (final Map.Entry<String, String> entry : attributes.entrySet()) {
                // TODO: Correct escaping
                out.write(" " + entry.getKey() + "=\"" + entry.getValue() + "\"");
            }
        }
        out.write(">");
        out.write("\n");
    } catch (final IOException e) {
        LOG.warn("Could not write open element: " + e.getMessage());
    }
}

From source file:com.googlecode.osde.internal.utils.MapUtil.java

public static Map<String, String> toMap(String data) throws IOException, ClassNotFoundException {

    if (StringUtils.isNotBlank(data)) {
        byte[] bytes = data.getBytes("UTF-8");
        byte[] decoded = Base64.decodeBase64(bytes);
        ByteArrayInputStream bais = new ByteArrayInputStream(decoded);
        ObjectInputStream in = new ObjectInputStream(bais);

        @SuppressWarnings("unchecked")
        Map<String, String> result = (Map<String, String>) in.readObject();
        return result;
    }//from  www . j  a  va2  s.c  o m

    return new HashMap<String, String>();
}

From source file:com.roncoo.pay.trade.utils.MerchantApiUtil.java

/**
 * ??//from   w w w . j  ava2 s. c om
 * @param paramMap
 * @return
 */
public static String getParamStr(Map<String, Object> paramMap) {
    SortedMap<String, Object> smap = new TreeMap<String, Object>(paramMap);
    StringBuffer stringBuffer = new StringBuffer();
    for (Map.Entry<String, Object> m : smap.entrySet()) {
        Object value = m.getValue();
        if (value != null && StringUtils.isNotBlank(String.valueOf(value))) {
            stringBuffer.append(m.getKey()).append("=").append(value).append("&");
        }
    }
    stringBuffer.delete(stringBuffer.length() - 1, stringBuffer.length());

    return stringBuffer.toString();
}