List of usage examples for org.apache.commons.lang StringUtils equalsIgnoreCase
public static boolean equalsIgnoreCase(String str1, String str2)
Compares two Strings, returning true
if they are equal ignoring the case.
From source file:net.shopxx.interceptor.ValidateInterceptor.java
@Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { if (!isValid(request)) { String requestType = request.getHeader("X-Requested-With"); if (StringUtils.equalsIgnoreCase(requestType, "XMLHttpRequest")) { response.addHeader("validateStatus", "accessDenied"); }/*from ww w .ja v a2 s . co m*/ response.sendError(HttpServletResponse.SC_FORBIDDEN, ERROR_MESSAGE); return false; } return true; }
From source file:net.shopxx.service.impl.OwnerServiceImpl.java
@Override public boolean noUnique(String previousNo, String currentNo) { if (StringUtils.equalsIgnoreCase(previousNo, currentNo)) { return true; } else {/*from w w w . j a v a 2s .c o m*/ if (ownerDao.noUnique(currentNo)) { return false; } else { return true; } } }
From source file:com.mmj.app.lucene.search.cons.TimeSearchEnum.java
/** * ?name?//from ww w . j a v a 2 s. com */ public static TimeSearchEnum getEnum(String name) { if (StringUtils.isEmpty(name)) { return ALL; } for (TimeSearchEnum current : values()) { if (StringUtils.equalsIgnoreCase(current.getName(), name)) { return current; } } return ALL; }
From source file:com.thistech.spotlink.model.Format.java
public Format get(String name) { if (StringUtils.equalsIgnoreCase(name, "1080p") || StringUtils.equalsIgnoreCase(name, "MPEG2HD")) { return HD_1080P; } else if (StringUtils.contains(name, "1080i")) { return HD_1080I; } else if (StringUtils.contains(name, "720p")) { return HD_720P; } else {/*from www .j av a 2s . c o m*/ return SD_480P; } }
From source file:com.inkubator.hrm.web.search.CompetencyGroupSearchParameter.java
public String getCompetencyTypeName() { if (StringUtils.equalsIgnoreCase(getKeyParam(), "competencyTypeName")) { competencyTypeName = getParameter(); } else {//from w ww . j a va2 s. co m competencyTypeName = null; } return competencyTypeName; }
From source file:net.shopxx.interceptor.TokenInterceptor.java
@Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { String token = WebUtils.getCookie(request, TOKEN_COOKIE_NAME); if (StringUtils.equalsIgnoreCase(request.getMethod(), "POST")) { if (StringUtils.isNotEmpty(token)) { String requestType = request.getHeader("X-Requested-With"); if (StringUtils.equalsIgnoreCase(requestType, "XMLHttpRequest")) { if (StringUtils.equals(token, request.getHeader(TOKEN_PARAMETER_NAME))) { return true; } else { response.addHeader("tokenStatus", "accessDenied"); }//from ww w. jav a 2s .co m } else { if (StringUtils.equals(token, request.getParameter(TOKEN_PARAMETER_NAME))) { return true; } } } else { WebUtils.addCookie(request, response, TOKEN_COOKIE_NAME, DigestUtils.md5Hex(UUID.randomUUID() + RandomStringUtils.randomAlphabetic(30))); } response.sendError(HttpServletResponse.SC_FORBIDDEN, ERROR_MESSAGE); return false; } else { if (StringUtils.isEmpty(token)) { token = DigestUtils.md5Hex(UUID.randomUUID() + RandomStringUtils.randomAlphabetic(30)); WebUtils.addCookie(request, response, TOKEN_COOKIE_NAME, token); } request.setAttribute(TOKEN_ATTRIBUTE_NAME, token); return true; } }
From source file:io.kamax.mxisd.UserIdType.java
public boolean is(String id) { return StringUtils.equalsIgnoreCase(this.id, id); }
From source file:com.gst.infrastructure.reportmailingjob.data.ReportMailingJobEmailAttachmentFileFormat.java
/** * Creates a new {@link ReportMailingJobEmailAttachmentFileFormat} object * /* w ww . j a va 2 s. c om*/ * @param value the value of the enum constant * @return {@link ReportMailingJobEmailAttachmentFileFormat} object */ public static ReportMailingJobEmailAttachmentFileFormat newInstance(final String value) { ReportMailingJobEmailAttachmentFileFormat emailAttachmentFileFormat = INVALID; if (StringUtils.equalsIgnoreCase(value, XLS.value)) { emailAttachmentFileFormat = XLS; } else if (StringUtils.equalsIgnoreCase(value, PDF.value)) { emailAttachmentFileFormat = PDF; } else if (StringUtils.equalsIgnoreCase(value, CSV.value)) { emailAttachmentFileFormat = CSV; } return emailAttachmentFileFormat; }
From source file:com.hangum.tadpole.rdb.core.dialog.dml.TableInformationLabelProvider.java
@Override public Image getColumnImage(Object element, int columnIndex) { if (columnIndex == 0) { ExtendTableColumnDAO columnDao = (ExtendTableColumnDAO) element; if (StringUtils.equalsIgnoreCase("PK", columnDao.getKey())) { return ResourceManager.getPluginImage(Activator.PLUGIN_ID, "resources/icons/objectExplorer/primary_key_column.png"); } else if (StringUtils.equalsIgnoreCase("FK", columnDao.getKey())) { return ResourceManager.getPluginImage(Activator.PLUGIN_ID, "resources/icons/objectExplorer/foreign_key_column.png"); } else if (StringUtils.equalsIgnoreCase("MUL", columnDao.getKey())) { return ResourceManager.getPluginImage(Activator.PLUGIN_ID, "resources/icons/objectExplorer/multi_key_column.png"); } else {/* w ww .ja va2 s . c o m*/ return ResourceManager.getPluginImage(Activator.PLUGIN_ID, "resources/icons/objectExplorer/column.png"); } } return null; }
From source file:com.dp2345.service.impl.ShopRankServiceImpl.java
@Transactional(readOnly = true) public boolean nameUnique(String previousName, String currentName) { if (StringUtils.equalsIgnoreCase(previousName, currentName)) { return true; } else {//from www.j av a2 s . com if (shopRankDao.nameExists(currentName)) { return false; } else { return true; } } }