Package com.sparc.knappsack.util

Examples of com.sparc.knappsack.util.UserAgentInfo


        }

        if (request != null && modelAndView != null && (!(modelAndView.getView() instanceof RedirectView) && !modelAndView.getViewName().startsWith("redirect:"))) {
            User user = userService.getUserFromSecurityContext();
            if (user != null) {
                ApplicationType deviceType = new UserAgentInfo(request.getHeader("User-Agent"), request.getHeader("Accept")).getApplicationType();
                // Get categories for side menu
                List<Category> categories = userService.getCategoriesForUser(user, deviceType, SortOrder.ASCENDING);
                List<MenuItem> categoryMenuItems = new ArrayList<MenuItem>();
                if (categories != null) {
                    for (Category category : categories) {
View Full Code Here


    @Override
    public Object resolveArgument(MethodParameter param,
                                  NativeWebRequest request) throws Exception {

        UserAgentInfo uAgentInfo = new UserAgentInfo(request.getHeader("User-Agent"), request.getHeader("Accept"));

        if (UAgentInfo.class.isAssignableFrom(param.getParameterType())) {
      return uAgentInfo;
    } else {
      return WebArgumentResolver.UNRESOLVED;
View Full Code Here

        File reqFile = new File(resourceFullName);
        return reqFile.exists();
    }

    private boolean checkUserAgentIsMobile(HttpServletRequest request) {
        UserAgentInfo uAgentInfo = new UserAgentInfo(request.getHeader("User-Agent"), request.getHeader("Accept"));

        return (uAgentInfo.detectMobileLong() || uAgentInfo.detectTierTablet());
    }
View Full Code Here

TOP

Related Classes of com.sparc.knappsack.util.UserAgentInfo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.