List of usage examples for org.apache.commons.lang StringUtils isNotBlank
public static boolean isNotBlank(String str)
Checks if a String is not empty (""), not null and not whitespace only.
From source file:com.googlecode.jtiger.modules.ecside.filter.ExportFilterUtils.java
public static String getExportFileName(WebContext context) { String tableId = getTableId(context); if (StringUtils.isNotBlank(tableId)) { String exportFileNameStr = tableId + "_" + TableConstants.EXPORT_FILE_NAME; String exportFileName = context.getParameter(exportFileNameStr); if (logger.isDebugEnabled()) { logger.debug(//from w w w .j a v a 2 s . co m "eXtremeTable export file name [" + exportFileNameStr + "] is [" + exportFileName + "]"); } return exportFileName; } return null; }
From source file:com.bsb.intellij.plugins.xmlbeans.utils.ValidationUtils.java
public static boolean isValidRelativePath(String path) { return StringUtils.isNotBlank(path) && path.matches(RELATIVE_PATH_REGEX); }
From source file:gov.nih.nci.protexpress.util.SearchCriteriaHelper.java
/** * Given a Date object, returns a Calendar. * * @param crit the Criteria//from w w w . jav a 2 s. c o m * @param params the search parameters * @param onlyCount parameter for getting the count only * @param sortProperty the sort property * @param sortDir the sort order * @return the Criteria */ public static Criteria getCriteria(Criteria crit, SearchParameters params, boolean onlyCount, String sortProperty, SortOrderEnum sortDir) { if (onlyCount) { crit.setProjection(Projections.rowCount()); } if (!onlyCount && sortDir != null && StringUtils.isNotBlank(sortProperty)) { if (SortOrderEnum.ASCENDING.equals(sortDir)) { crit.addOrder(Order.asc(sortProperty)); } else { crit.addOrder(Order.desc(sortProperty)); } } if ((params != null) && (StringUtils.isNotEmpty(params.getName()))) { crit.add(Restrictions.like("name", "%" + params.getName() + "%").ignoreCase()); } // crit.createAlias("auditInfo", "audit"); if ((params != null) && !params.getSearchAllUsers()) { crit.add(Restrictions.eq("auditInfo.creator", UserHolder.getUsername())); } if ((params != null) && (params.getFromDate() != null)) { crit.add(Restrictions.ge("auditInfo.lastModifiedDate", DateHelper.getDate(params.getFromDate()))); } if ((params != null) && (params.getToDate() != null)) { crit.add(Restrictions.le("auditInfo.lastModifiedDate", DateHelper.getDate(params.getToDate()))); } return crit; }
From source file:com.funtl.framework.smoke.core.modules.sys.utils.quartz.TaskUtils.java
/** * ??scheduleJob/*from ww w .ja va2 s. co m*/ * * @param taskJob */ public static void invokMethod(TaskJob taskJob) { Object object = null; Class clazz = null; if (StringUtils.isNotBlank(taskJob.getTaskJobSpring())) { object = SpringContextHolder.getBean(taskJob.getTaskJobSpring()); } else if (StringUtils.isNotBlank(taskJob.getTaskJobBean())) { try { clazz = Class.forName(taskJob.getTaskJobBean()); object = clazz.newInstance(); } catch (Exception e) { e.printStackTrace(); } } if (object == null) { logger.error("?? = [" + taskJob.getTaskJobName() + "]---------------???????"); return; } clazz = object.getClass(); Method method = null; try { method = clazz.getDeclaredMethod(taskJob.getTaskJobMethod()); } catch (NoSuchMethodException e) { logger.error("?? = [" + taskJob.getTaskJobName() + "]---------------???????"); } catch (SecurityException e) { e.printStackTrace(); } if (method != null) { try { method.invoke(object); } catch (IllegalAccessException e) { e.printStackTrace(); } catch (IllegalArgumentException e) { e.printStackTrace(); } catch (InvocationTargetException e) { e.printStackTrace(); } } logger.debug("?? = [" + taskJob.getTaskJobName() + "]----------??"); }
From source file:com.qualogy.qafe.business.resource.rdb.query.enhancer.EnhancementManager.java
private static Query enhance(Query query, QueryContainer container, DatabaseMetaData md) { if (StringUtils.isNotBlank(query.getRef())) { Query reference = container.get(query.getRef()); if (reference == null) { throw new EnhancementFailedException("Referencing to non-existing query, ref=" + query.getRef()); }//from w w w .jav a 2 s.com query.setReference(reference); } else { Enhancer enhancer = EnhancerFactory.create(query); if (enhancer != null) { query = enhancer.enhance(query, md); logger.info("Enhanced query with id [" + query.getId() + "]"); } } return query; }
From source file:com.baidu.rigel.biplatform.parser.node.impl.NodeFactory.java
public static FunctionNode makeFunctionNodeByFunctionName(String name) throws InstantiationException, IllegalAccessException, IllegalArgumentException, InvocationTargetException { if (StringUtils.isNotBlank(name)) { Constructor<? extends FunctionNode> construct = RegisterFunction.getConstructorByFunctionName(name); if (construct != null) { return construct.newInstance(); } else {// w w w.j a va 2 s . co m throw new IllegalFunctionException("function name:" + name + " has not implement."); } } else { throw new IllegalArgumentException("function name can not be null!"); } }
From source file:gov.nih.nci.protexpress.util.UserHolder.java
/** * @return the display name of the currently logged in user, or null *///from w w w . j av a 2 s.c om public static String getDisplayNameForUser() { String name = null; User user = UserHolder.getUser(); if (user != null) { if (StringUtils.isNotBlank(user.getFirstName()) && StringUtils.isNotBlank(user.getLastName())) { name = user.getFirstName() + " " + user.getLastName(); } else { name = user.getLoginName(); } } return name; }
From source file:com.ruzhi.demo.lifeserverweb.StringUtil.java
/** * mapstr=id:123;name:xiaoqiang?//from w ww . j ava 2 s . c om * * @param str * @param splitStr1 (;) * @param splitStr2 (:) * @return */ public static Map<String, String> getStr2Map(String str, String splitStr1, String splitStr2) { if (StringUtils.isNotBlank(str)) { String[] a = str.split(splitStr1); if (a != null && a.length > 0) { Map<String, String> map = new HashMap<String, String>(); for (String s : a) { if (StringUtils.isNotBlank(s)) { String[] b = s.split(splitStr2); if (b != null && b.length >= 1) { String value = (b.length == 2 ? b[1] : ""); map.put(b[0], value.trim()); } } } return map; } } return null; }
From source file:com.roncoo.utils.MerchantApiUtil.java
/** * ????/*from w w w.jav a2 s. co m*/ * @param paramMap ??? * @param paySecret ?? * @return */ public static String getSign(Map<String, Object> paramMap, String paySecret) { 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(m.getValue()).append("&"); } } stringBuffer.delete(stringBuffer.length() - 1, stringBuffer.length()); String argPreSign = stringBuffer.append("&paySecret=").append(paySecret).toString(); String signStr = MD5Util.encode(argPreSign).toUpperCase(); return signStr; }
From source file:com.billing.ng.crypto.util.PasswordUtils.java
public static Integer getSaltLength() { if (saltLength == null) { String prop = System.getProperty("crypto.hash.salt_length", "256"); saltLength = StringUtils.isNotBlank(prop) ? Integer.valueOf(prop) : 256; }//from w w w .ja v a 2 s . com return saltLength; }