====== Java ====== ===== function ===== ^연산^형식^반환 형식^사용된 함수형 인터페이스 형식^함수 디스크립터^ |filter|중간 연산|Stream|Predicate|T -> boolean| |distinct|중간 연산(상태 있는 언바운드)|Stream| | | |takeWhile|중간 연산|Stream|Predicate|T -> boolean| |dropWhile|중간 연산|Stream|Predicate|T -> boolean| |skip|중간 연산(상태 있는 언바운드)|Stream|long| | |limit|중간 연산(상태 있는 언바운드)|Stream|long| | |map|중간 연산|Stream|Function|T -> R| |flatMap|중간 연산|Stream|Function >|T -> Stream| |sorted|중간 연산(상태 있는 언바운드)|Stream|Comparator|(T, T) -> int| |anyMatch|최종 연산|boolean|Predicate|T -> boolean| |noneMatch|최종 연산|boolean|Predicate|T -> boolean| |allMatch|최종 연산|boolean|Predicate|T -> boolean| |findAny|최종 연산|Optional| | | |findFirst|최종 연산|Optional| | | |forEach|최종 연산|void|Consumer|T -> void| |collect|최종 연산|R|Collector| | |reduce|최종 연산(상태 있는 바운드)|Optional|BinaryOperator|(T, T) -> T| |count|최종 연산|long| | | ===== Java Library ===== ===== Web Progress Bar? ===== * [[https://stackoverflow.com/questions/1106377/detect-when-browser-receives-file-download|Detect When Browser Receives File Download]] ==== Remote IP address ===== 다양한 L4에 대한 Client IP Address얻기 import javax.servlet.http.HttpServletRequest; public class IPTraceUtils { public static String getRemoteAddr(HttpServletRequest request) { String ip = null; ip = request.getHeader("X-Forwarded-For"); if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("Proxy-Client-IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("WL-Proxy-Client-IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("HTTP_CLIENT_IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("HTTP_X_FORWARDED_FOR"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("X-Real-IP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("X-RealIP"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getHeader("REMOTE_ADDR"); } if (ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) { ip = request.getRemoteAddr(); } return ip; } }