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.mosso.client.cloudfiles.sample.FilesMakeContainer.java

private static void createContaier(String containerName) throws HttpException, IOException, FilesException {
    if (!StringUtils.isNotBlank(containerName) || containerName.indexOf('/') != -1) {
        System.err.println("You must provide a valid value for the  Container name !");
        System.exit(-1);//from w  w w .  ja v  a 2 s.co m
    } //if (!StringUtils.isNotBlank(containerName))

    //Check to see if a Container with this name already exists

    FilesClient client = new FilesClient();
    if (client.login()) {
        client.createContainer(containerName);
    } else
        System.out.println("Failed to login to Cloud Files!");

    System.exit(0);

}

From source file:io.sidecar.org.Application.java

public Application(UUID orgId, String name, String description) {
    Preconditions.checkNotNull(orgId);/*from   w w w  .j av  a  2  s . c  om*/
    this.orgId = orgId;

    // assign the AppId
    this.appId = UUID.randomUUID();

    Preconditions.checkNotNull(name);
    Preconditions.checkArgument(StringUtils.isNotBlank(name));
    this.name = name;

    Preconditions.checkNotNull(description);
    Preconditions.checkArgument(StringUtils.isNotBlank(description));
    this.description = description;
}

From source file:com.openshift.internal.restclient.model.List.java

public List(ModelNode node, IClient client, Map<String, String[]> propertyKeys) {
    super(node, client, propertyKeys);
    String listKind = asString(KIND);
    if (StringUtils.isNotBlank(listKind)) {
        kind = listKind.substring(0, listKind.length() - "List".length());
    }/*from  w  w  w  .j av a  2  s. c om*/

}

From source file:com.twitter.hraven.util.HadoopConfUtil.java

/**
 * checks if the jobConf contains a certain parameter
 * /*w  ww.  j a  va2s. c  om*/
 * @param jobConf
 * @param name
 * @return true if the job conf contains that parameter
 *         false if the job conf does not contain that parameter
 */
public static boolean contains(Configuration jobConf, String name) {
    if (StringUtils.isNotBlank(jobConf.get(name))) {
        return true;
    } else {
        return false;
    }
}

From source file:com.thoughtworks.go.server.domain.oauth.OauthDomainEntity.java

protected void setIdIfAvailable(Map attributes) {
    Object value = attributes.get(PARAM_ID);
    if (StringUtils.isNotBlank(String.valueOf(value))) {
        Long aLong = (Long) attributes.get(PARAM_ID);
        if (aLong != null && aLong > 0) {
            this.id = aLong;
        }//from   w w w  .  ja v a2  s  . c om
    }
}

From source file:com.zxy.commons.redis.RedisPropUtils.java

/**
 * servers?//from  w w w  .j a  v a 2s .  c o  m
 * 
 * @return servers
 */
public static Set<String> getServers() {
    String servers = JedisPropUtilsBuilder.INSTANCE.getString("servers");
    Set<String> serverses = new HashSet<String>();
    if (StringUtils.isNotBlank(servers)) {
        String[] serversArray = servers.split("[\\s\\,]");
        for (String s : serversArray) {
            serverses.add(s);
        }
    }
    return serverses;
}

From source file:com.pscnlab.train.daos.impls.TrainDaoImpl.java

@Override
public Page<Train> findPageByTime(String time, Integer offset, Integer size) {
    FilterMap filterMap = new FilterMap();
    if (StringUtils.isNotBlank(time)) {
        filterMap.eq("time", time);
    }// w  ww  .ja v  a2s .  c om
    return super.page(filterMap, offset, size);
}

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

public void buildTool() {

    String extend = (String) getTableModel().getTable().getAttribute("ExtendTool");
    getHtmlBuilder().td(1).styleClass("extendTool").close();
    if (StringUtils.isNotBlank(extend)) {
        getHtmlBuilder().append(extend);
    }//  w  ww  . j av  a 2s.com
    getHtmlBuilder().tdEnd();

}

From source file:com.msds.km.controller.DrivingLicenseController.java

/**
 * ??/*from   w  ww.j ava 2 s.c  o  m*/
 * 
 * @param file
 * @return
 */
@RequestMapping(value = "/recongnize", method = RequestMethod.POST)
public BaseResponse recongnize(String file, HttpServletRequest request) throws IOException {
    if (StringUtils.isNotBlank(file)) {
        try {
            byte[] b = Base64.decode(file);
            if (b == null)
                return retEnumResponse(FileUpdateResponseEnum.code_1600);
            if (b.length > CommonAttributes.MAX_FILE_SIZE)
                return retEnumResponse(FileUpdateResponseEnum.code_1601);
            DrivingLicense drivingLicense = drivingLicenseRecognitionServcie.recognition(b);
            if (drivingLicense != null) {
                return returnResponse(SUCCESS_CODE, drivingLicense);
            } else {
                return retEnumResponse(DrivingLicenseResponseEnum.code_1300);
            }
        } catch (Exception e) {
            logger.error("?", e);
            return retEnumResponse(DrivingLicenseResponseEnum.code_1301);
        }

    } else {
        return retEnumResponse(DrivingLicenseResponseEnum.code_1302);
    }
}

From source file:com.vangent.hieos.services.xds.bridge.utils.UUIDUtils.java

/**
 * Method description//from  w  ww .j  a v a 2  s .  c  om
 *
 *
 * @param uuid
 * @param prefix
 *
 * @return
 */
public static String toOID(UUID uuid, String prefix) {

    String result = null;

    if ((uuid != null) && StringUtils.isNotBlank(prefix)) {

        String uuidstr = uuid.toString().replaceAll("-", "");
        BigInteger bi = new BigInteger(uuidstr, 16);

        result = String.format("%s.%s", prefix, bi.toString());
    }

    return result;
}