if (itemPath.equals("")) itemPath = "/";
        Context(HttpServletRequest request, HttpServletResponse response, UserServlet servlet)        throws UserServletException, ServiceException {            Provisioning prov = Provisioning.getInstance();            this.req = request;            this.resp = response;            this.params = HttpUtil.getURIParams(request);            String pathInfo = request.getPathInfo().toLowerCase();            if (pathInfo == null || pathInfo.equals("/") || pathInfo.equals("") || !pathInfo.startsWith("/"))                throw new UserServletException(HttpServletResponse.SC_BAD_REQUEST, "invalid path");            int pos = pathInfo.indexOf('/', 1);            if (pos == -1)                throw new UserServletException(HttpServletResponse.SC_BAD_REQUEST, "invalid path");            String checkInternalDispatch = (String) request.getAttribute("zimbra-internal-dispatch");            if (checkInternalDispatch != null && checkInternalDispatch.equals("yes")) {                // XXX extra decoding is necessary if the HttpRequest was                // re-dispatched internally from SetHeaderFilter class in                // zimbra app.  it appears org.apache.catalina.core.ApplicationHttpRequest                // does not perform URL decoding on pathInfo.  refer to                // bug 8159.                try {                    pathInfo = URLDecoder.decode(pathInfo, "UTF-8");                } catch (UnsupportedEncodingException uee) {                    ZimbraLog.misc.info("cannot decode pathInfo " + pathInfo);                }            }            this.accountPath = pathInfo.substring(1, pos);            this.itemPath = pathInfo.substring(pos + 1);            this.format = this.params.get(QP_FMT);            String id = this.params.get(QP_ID);            try {                this.itemId = id == null ? null : new ItemId(id, null);            } catch (ServiceException e) {                throw new UserServletException(HttpServletResponse.SC_BAD_REQUEST, "invalid id requested");            }            String imap = this.params.get(QP_IMAP_ID);            try {                this.imapId = imap == null ? -1 : Integer.parseInt(imap);            } catch (NumberFormatException nfe) {                throw new UserServletException(HttpServletResponse.SC_BAD_REQUEST, "invalid imap id requested");            }            if (this.format != null) {                this.format = this.format.toLowerCase();                this.formatter = servlet.getFormatter(this.format);                if (this.formatter == null)                    throw new UserServletException(HttpServletResponse.SC_NOT_IMPLEMENTED, "not implemented yet");            }                            // see if we can get target account or not            if (itemId != null && itemId.getAccountId() != null) {                targetAccount = prov.get(AccountBy.id, itemId.getAccountId());                return;            } else if (accountPath.equals("~")) {                // can't resolve this yet                return;            } else if (accountPath.startsWith("~")) {                accountPath = accountPath.substring(1);            }            targetAccount = prov.get(AccountBy.name, accountPath);                        }