List of usage examples for org.apache.commons.lang StringUtils isNotEmpty
public static boolean isNotEmpty(String str)
Checks if a String is not empty ("") and not null.
From source file:costumetrade.common.wenqian.util.WQSignUtils.java
public static void main(String[] args) { String token = getToken();//from ww w . j a v a 2 s . c o m System.err.println(token); String entNameA = "BBBB?"; String adminUserA = "?BB"; String adminPhoneA = "15809999991"; boolean bool1 = syncUsertowq(token, entNameA, adminUserA, adminPhoneA, null, "", ""); System.err.println("?" + bool1); String entNameB = "BBBB"; String adminUserB = "BB"; String adminPhoneB = "15809999992"; boolean bool2 = syncUsertowq(token, entNameB, adminUserB, adminPhoneB, null, "", ""); System.err.println("?" + bool2); String orderNo = "nfdb20161516984789"; File file = new File("E:\\wq.docx"); if (bool1 && bool2) { String documentId = uploadContract(token, adminPhoneA, orderNo, file); if (StringUtils.isNotEmpty(documentId)) { System.err.println("???,ID" + documentId); String signer = sendKeyword(token, adminPhoneA, adminPhoneB, documentId, "", ""); System.err.println(signer); File stampfile = new File("E:\\image\\hr-stamp.png"); String entName = ""; SignContractUtil.uploadstamp(token, adminPhoneA, stampfile, entName); } else { System.err.println("??!"); } } }
From source file:com.canoo.webtest.util.ConversionUtil.java
/** * Convert a string value to a boolean according to ANT defintion of true. If the value is null or empty, return the * specified default value.//from w ww.j a v a 2 s .c o m * * @return parsed value. If value is null or empty, return default value. */ public static boolean convertToBoolean(String value, boolean defaultValue) { if (StringUtils.isNotEmpty(value)) { // isNotBlank? return "yes".equalsIgnoreCase(value) || "true".equalsIgnoreCase(value) || "on".equalsIgnoreCase(value); } return defaultValue; }
From source file:com.microsoft.alm.plugin.external.utils.ProcessHelper.java
public static Process startProcess(final String workingDirectory, final List<String> arguments) throws IOException { final ProcessBuilder pb = new ProcessBuilder(arguments); // Disable any telemetry that the tool may initiate pb.environment().put("tf_notelemetry", "TRUE"); pb.environment().put("TF_ADDITIONAL_JAVA_ARGS", "-Duser.country=US -Duser.language=en"); if (StringUtils.isNotEmpty(workingDirectory)) { pb.directory(new File(workingDirectory)); }/*ww w . j a v a2s. com*/ return pb.start(); }
From source file:com.liferay.maven.plugins.util.Validator.java
public static boolean isNotNull(String s) { return StringUtils.isNotEmpty(s); }
From source file:net.sf.sze.util.StringUtil.java
/** * Wandelt einen String, der eine Komma oder Leerzeichen separierte Liste * darstellt in eine Liste um./*from ww w . ja v a 2 s .c o m*/ * @param listAsString die Liste als String. * @return die Liste. */ public static List<String> convertStringToList(String listAsString) { if (StringUtils.isNotEmpty(listAsString)) { return Arrays.asList(listAsString.trim().split("[ ,]+")); } else { return new ArrayList<String>(); } }
From source file:com.assemblade.opendj.acis.Subject.java
public static Subject parse(String rule) { if (StringUtils.isNotEmpty(rule)) { rule = rule.trim();//from ww w . ja v a 2s . c o m char[] ruleArray = rule.toCharArray(); if (rule.startsWith("(")) { int brackets = 0; for (int position = 0; position < ruleArray.length; position++) { if (ruleArray[position] == '(') { brackets++; } else if (ruleArray[position] == ')') { brackets--; } if (brackets == 0) { Subject subject = Subject.parse(rule.substring(1, position)); if (position < (ruleArray.length - 1)) { return CompositeSubject.parse(subject, rule.substring(position + 1)); } return subject; } } } else { return PermissionSubject.parse(rule); } } return null; }
From source file:com.supermap.desktop.icloud.utils.ValidationUtil.java
public static void validate(ApplyFormalLicenseRequest request) { if (request.licenseId != null) { System.out.println("licenseId parameter is required"); }// www .ja va 2 s .c om if (StringUtils.isNotEmpty(request.licenseId.value())) { System.out.println("licenseId parameter is required"); } if (request.machine != null) { System.out.println("machine parameter is required"); } if (StringUtils.isNotEmpty(request.machine.name)) { System.out.println("machine's name parameter is required"); } if (StringUtils.isNotEmpty(request.machine.macAddr)) { System.out.println("machine's macAddr parameter is required"); } if (request.software != null) { System.out.println("software parameter is required"); } if (request.software.productType != null) { System.out.println("software's productType parameter is required"); } if (request.software.version != null) { System.out.println("software's version parameter is required"); } }
From source file:gov.nih.nci.iso21090.reference.convert.PersonNameConverterUtil.java
private static void addEnxp(EnPn enpn, String value, EntityNamePartType type) { if (StringUtils.isNotEmpty(value)) { Enxp part = new Enxp(type); part.setValue(value);//from ww w . jav a 2s. c o m enpn.getPart().add(part); } }
From source file:com.microsoft.alm.plugin.idea.common.settings.TeamServicesSecrets.java
public static AuthenticationInfo load(final String key) throws IOException { final String authInfoSerialized = readPassword(key); AuthenticationInfo info = null;/*from w w w.j a va 2 s.co m*/ if (StringUtils.isNotEmpty(authInfoSerialized)) { info = JsonHelper.read(authInfoSerialized, AuthenticationInfo.class); } if (info == null) { forget(key); logger.warn("getServerContextSecrets: info was null for key: ", key); return null; } return info; }
From source file:jp.co.opentone.bsol.framework.test.util.ExpectedMessageStringGenerator.java
public static String generate(String msg, String actionName, Object... vars) { if (StringUtils.isNotEmpty(actionName)) { msg = msg.replace("$action$", "?[" + actionName + "]"); }//from w ww . j a v a2 s.com assertTrue(!msg.matches("\\$action\\$")); String result = MessageFormat.format(msg, vars); assertTrue(!result.matches("\\{[0-9]+\\}")); return result; }