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.richeninfo.springmvcex.ClientReturnUtils.java
public static Map<String, Object> createReturnMap(Boolean result, String msg) { Map map = createReturnMap(result); if (StringUtils.isNotBlank(msg)) { map.put("message", msg); }//www. j av a2 s . c o m return map; }
From source file:com.taobao.ad.easyschedule.exsession.request.session.SessionDecode.java
public static String decode(String encoded) { String result = null;//from w w w . j a va2 s . c o m if (StringUtils.isNotBlank(encoded)) { try { byte[] decoded = Base64.decodeBase64(encoded.getBytes()); result = new String(decoded); } catch (Exception e) { fLog.info(e.getMessage()); result = ""; } } return result; }
From source file:com.taobao.ad.easyschedule.exsession.request.session.SessionEncode.java
public static String encode(String aStr) { String result = null;//from w w w.j a v a 2 s. c om try { if (StringUtils.isNotBlank(aStr)) { result = new String(Base64.encodeBase64(aStr.getBytes())); } } catch (Exception ex) { fLog.info(ex.getMessage()); } return result; }
From source file:adalid.commons.util.ThrowableUtils.java
public static String getString(Throwable throwable) { if (throwable == null) { return Throwable.class.getName(); }/*from ww w . ja v a 2s . c o m*/ String string; Throwable cause = throwable.getCause(); if (cause != null) { return getString(cause); } string = throwable.getLocalizedMessage(); if (StringUtils.isNotBlank(string)) { return getString(string); } string = throwable.getMessage(); if (StringUtils.isNotBlank(string)) { return getString(string); } string = throwable.toString(); if (StringUtils.isNotBlank(string)) { return getString(string); } return Throwable.class.getSimpleName(); }
From source file:bazaar4idea.command.BzrErrorUtil.java
static boolean isAbort(BzrAbstractResult result) { String line = getLastErrorLine(result); return StringUtils.isNotBlank(line) && StringUtils.contains(line, "abort:"); }
From source file:io.sidecar.ModelUtils.java
public static boolean isValidStreamId(String stream) { return StringUtils.isNotBlank(stream) && CharMatcher.WHITESPACE.matchesNoneOf(stream); }
From source file:com.mobileman.projecth.web.util.NumUtils.java
public static Long convert2long(String str) { try {/* w ww. j a va2 s . co m*/ if (StringUtils.isNotBlank(str)) { return Long.parseLong(str); } } catch (Exception ex) { } return null; }
From source file:com.qp.basic.util.SysConstUtil.java
/** * ?????//from w ww . j a va2 s. co m * @Title: covertToRealUrl * @param relativeUrl * @return String * @author ls */ public static String covertToRealUrl(String relativeUrl) { if (StringUtils.isNotBlank(relativeUrl)) { relativeUrl = HTTP_FILE_SYS_BASE_URL + relativeUrl; } return relativeUrl; }
From source file:com.greenline.guahao.web.module.home.controllers.mobile.PageUtils.java
/** * ???url//from w w w .ja v a2 s. c o m * * @param request * @return String */ public static String getCurrUrl(HttpServletRequest request) { String url = CommonUtils.getRequestUrl(request); if (StringUtils.isNotBlank(url)) { url = url.replaceAll("&pageNo=\\d+$", "").replaceAll("pageNo=\\d+$", ""); } if (!url.contains("?")) { url += "?"; } else { if (!url.endsWith("?")) { url += "&"; } } url += "pageNo="; return url; }
From source file:io.sidecar.ModelUtils.java
public static boolean isValidReadingKey(String key) { return StringUtils.isNotBlank(key) && key.length() <= 40 && CharMatcher.WHITESPACE.matchesNoneOf(key); }