/** * Construct */ public BasicHttpAuthenticator(WebScriptServletRequest req, WebScriptServletResponse res) { this.servletReq = req; this.servletRes = res; HttpServletRequest httpReq = servletReq.getHttpServletRequest(); this.authorization = httpReq.getHeader("Authorization"); }
@SuppressWarnings("deprecation") @Override protected WebScriptRequest createRequest(Match match) { // TODO: construct org.springframework.extensions.webscripts.servlet.WebScriptServletResponse when // org.alfresco.web.scripts.WebScriptServletResponse (deprecated) is removed servletReq = new WebScriptServletRequest(this, req, match, serverProperties); return servletReq; }
public String getServicePath() { String pathInfo = getPathInfo(); return getServiceContextPath() + ((pathInfo == null) ? "" : pathInfo); }
public String getURL() { String queryString = getQueryString(); if (queryString != null) { return getServicePath() + "?" + queryString; } return getServicePath(); }
public String getServerPath() { return getServerScheme() + "://" + getServerName() + ":" + getServerPort(); }
this.serviceMatch = serviceMatch; String contentType = getContentType(); this.formData = (FormData)parseContent();
public Content getContent() { // ensure we only try to read the content once - as this method may be called several times // but the underlying inputstream itself can only be processed a single time if (content == null) { try { content = new InputStreamContent(req.getInputStream(), getContentType(), req.getCharacterEncoding()); } catch(IOException e) { throw new WebScriptException("Failed to retrieve request content", e); } } return content; }
public String getPathInfo() { // NOTE: Don't use req.getPathInfo() - it truncates the path at first semi-colon in Tomcat final String requestURI = req.getRequestURI(); final String serviceContextPath = getServiceContextPath(); String pathInfo; if (serviceContextPath.length() > requestURI.length()) { // NOTE: assume a redirect has taken place e.g. tomcat welcome-page // NOTE: this is unlikely, and we'll take the hit if the path contains a semi-colon pathInfo = req.getPathInfo(); } else { pathInfo = URLDecoder.decode(requestURI.substring(serviceContextPath.length())); } return pathInfo; }
public String getServerPath() { return getServerScheme() + "://" + getServerName() + ":" + getServerPort(); }
public String getURL() { String queryString = getQueryString(); if (queryString != null) { return getServicePath() + "?" + queryString; } return getServicePath(); }
this.serviceMatch = serviceMatch; String contentType = getContentType(); this.formData = (FormData)parseContent();
public Content getContent() { // ensure we only try to read the content once - as this method may be called several times // but the underlying inputstream itself can only be processed a single time if (content == null) { try { content = new InputStreamContent(req.getInputStream(), getContentType(), req.getCharacterEncoding()); } catch(IOException e) { throw new WebScriptException("Failed to retrieve request content", e); } } return content; }
public String getPathInfo() { // NOTE: Don't use req.getPathInfo() - it truncates the path at first semi-colon in Tomcat final String requestURI = req.getRequestURI(); final String serviceContextPath = getServiceContextPath(); String pathInfo; if (serviceContextPath.length() > requestURI.length()) { // NOTE: assume a redirect has taken place e.g. tomcat welcome-page // NOTE: this is unlikely, and we'll take the hit if the path contains a semi-colon pathInfo = req.getPathInfo(); } else { pathInfo = URLDecoder.decode(requestURI.substring(serviceContextPath.length())); } return pathInfo; }
/** * Construct */ public BasicHttpAuthenticator(WebScriptServletRequest req, WebScriptServletResponse res) { this.servletReq = req; this.servletRes = res; HttpServletRequest httpReq = servletReq.getHttpServletRequest(); this.authorization = httpReq.getHeader("Authorization"); }
public String getServerPath() { return getServerScheme() + "://" + getServerName() + ":" + getServerPort(); }
public String getServicePath() { String pathInfo = getPathInfo(); return getServiceContextPath() + ((pathInfo == null) ? "" : pathInfo); }
public String getURL() { String queryString = getQueryString(); if (queryString != null) { return getServicePath() + "?" + queryString; } return getServicePath(); }
this.serviceMatch = serviceMatch; String contentType = getContentType(); this.formData = (FormData)parseContent();
@SuppressWarnings("deprecation") @Override protected WebScriptRequest createRequest(Match match) { // TODO: construct org.springframework.extensions.webscripts.servlet.WebScriptServletResponse when // org.alfresco.web.scripts.WebScriptServletResponse (deprecated) is removed servletReq = new WebScriptServletRequest(this, req, match, serverProperties); return servletReq; }
public Content getContent() { // ensure we only try to read the content once - as this method may be called several times // but the underlying inputstream itself can only be processed a single time if (content == null) { try { content = new InputStreamContent(req.getInputStream(), getContentType(), req.getCharacterEncoding()); } catch(IOException e) { throw new WebScriptException("Failed to retrieve request content", e); } } return content; }