Java Code Examples for org.apache.commons.lang.StringUtils.indexOfIgnoreCase()

The following are Jave code examples for showing how to use indexOfIgnoreCase() of the org.apache.commons.lang.StringUtils class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: sonar-css-plugin   File: CommentContainsPatternChecker.java   Source Code and License Vote up 5 votes
private static boolean isLetterAround(String line, String pattern) {
  int start = StringUtils.indexOfIgnoreCase(line, pattern);
  int end = start + pattern.length();

  boolean pre = start > 0 && Character.isLetter(line.charAt(start - 1));
  boolean post = end < line.length() - 1 && Character.isLetter(line.charAt(end));

  return pre || post;
}
 
Example 2
Project: JYLAND   File: BoardController.java   Source Code and License Vote up 5 votes
@RequestMapping(value = "boarddetail.jy", method = { RequestMethod.POST, RequestMethod.GET })
public String freedetail(JYBoard board, HttpServletRequest request, 
		HttpServletResponse response, Model model) {
	logger.info("Welcome BoardController boarddetail! ---------------------------------------");
	Cookie cookies[]=request.getCookies();
	Map<String, String> map=new HashMap<>();
	if(cookies!=null) {
		for (int i = 0; i < cookies.length; i++) {
			Cookie tempCookie=cookies[i];
			map.put(tempCookie.getName(), tempCookie.getValue());
			logger.info("Welcome BoardController boarddetail! -----------------------------------name "+
			tempCookie.getName()+" value "+tempCookie.getValue());
		}
	}
	String readCount=map.get("readcount_"+board.getSeq());
	String newReadCount="readcount_"+board.getSeq();
	if(StringUtils.indexOfIgnoreCase(readCount, newReadCount)==-1) {
		Cookie cookie=new Cookie("readcount_"+board.getSeq(),"readcount_"+board.getSeq());
		cookie.setMaxAge(24*60*60);
		response.addCookie(cookie);
		
		boardService.updateReadcount(board);
	}
	JYBoardMap bm=new JYBoardMap(boardService.getBoard(board));
	request.getSession().setAttribute("bestcategorylist", categoryService.getPopCatList());
	request.getSession().setAttribute("categorylist", categoryService.getCatList());
	model.addAttribute("boarddetail", bm);
	logger.info("Welcome BoardController boarddetail! " + bm);
	return "boarddetail.tiles";
}