/** * RSS feed for log entries. * * @deprecated * As on 1.267, moved to "/log/rss..." */ @Deprecated public void doLogRss( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { String qs = req.getQueryString(); rsp.sendRedirect2("./log/rss"+(qs==null?"":'?'+qs)); }
/** * Changes the icon size by changing the cookie */ public void doIconSize( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { String qs = req.getQueryString(); if(qs==null) throw new ServletException(); Cookie cookie = new Cookie("iconSize", Functions.validateIconSize(qs)); cookie.setMaxAge(/* ~4 mo. */9999999); // #762 rsp.addCookie(cookie); String ref = req.getHeader("Referer"); if(ref==null) ref="."; rsp.sendRedirect2(ref); }
/** * Checks if the user was successfully authenticated. * * @see BasicAuthenticationFilter */ public void doSecured( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { // TODO fire something in SecurityListener? (seems to be used only for REST calls when LegacySecurityRealm is active) if(req.getUserPrincipal()==null) { // authentication must have failed rsp.setStatus(HttpServletResponse.SC_UNAUTHORIZED); return; } // the user is now authenticated, so send him back to the target String path = req.getContextPath()+req.getOriginalRestOfPath(); String q = req.getQueryString(); if(q!=null) path += '?'+q; rsp.sendRedirect2(path); }
/** * RSS feed for log entries. * * @deprecated * As on 1.267, moved to "/log/rss..." */ @Deprecated public void doLogRss( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { String qs = req.getQueryString(); rsp.sendRedirect2("./log/rss"+(qs==null?"":'?'+qs)); }
void doDynamic(StaplerRequest request, StaplerResponse rsp) throws IOException { rsp.sendRedirect(".?"+request.getQueryString()); } });
/** * RSS feed for log entries. * * @deprecated As on 1.267, moved to "/log/rss..." */ public void doLogRss(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { String qs = req.getQueryString(); rsp.sendRedirect2("./log/rss" + (qs == null ? "" : '?' + qs)); }
/** * RSS feed for log entries. * * @deprecated * As on 1.267, moved to "/log/rss..." */ public void doLogRss(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { String qs = req.getQueryString(); rsp.sendRedirect2("./log/rss" + (qs == null ? "" : '?' + qs)); }
/** * RSS feed for log entries. * * @deprecated * As on 1.267, moved to "/log/rss..." */ public void doLogRss(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { String qs = req.getQueryString(); rsp.sendRedirect2("./log/rss" + (qs == null ? "" : '?' + qs)); }
/** * RSS feed for log entries. * * @deprecated * As on 1.267, moved to "/log/rss..." */ public void doLogRss(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { String qs = req.getQueryString(); rsp.sendRedirect2("./log/rss" + (qs == null ? "" : '?' + qs)); }
/** * Changes the icon size by changing the cookie */ public void doIconSize(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { String qs = req.getQueryString(); if (qs == null || !ICON_SIZE.matcher(qs).matches()) { throw new ServletException(); } Cookie cookie = new Cookie("iconSize", qs); cookie.setMaxAge(/* ~4 mo. */9999999); // #762 rsp.addCookie(cookie); String ref = req.getHeader("Referer"); if (ref == null) { ref = "."; } rsp.sendRedirect2(ref); }
/** * Changes the icon size by changing the cookie */ public void doIconSize(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { String qs = req.getQueryString(); if (qs == null || !ICON_SIZE.matcher(qs).matches()) { throw new ServletException(); } Cookie cookie = new Cookie("iconSize", qs); cookie.setMaxAge(/* ~4 mo. */9999999); // #762 rsp.addCookie(cookie); String ref = req.getHeader("Referer"); if (ref == null) { ref = "."; } rsp.sendRedirect2(ref); }
/** * Changes the icon size by changing the cookie */ public void doIconSize(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { String qs = req.getQueryString(); if (qs == null || !ICON_SIZE.matcher(qs).matches()) { throw new ServletException(); } Cookie cookie = new Cookie("iconSize", qs); cookie.setMaxAge(/* ~4 mo. */9999999); // #762 rsp.addCookie(cookie); String ref = req.getHeader("Referer"); if (ref == null) { ref = "."; } rsp.sendRedirect2(ref); }
/** * Changes the icon size by changing the cookie */ public void doIconSize(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { String qs = req.getQueryString(); if (qs == null || !ICON_SIZE.matcher(qs).matches()) { throw new ServletException(); } Cookie cookie = new Cookie("iconSize", qs); cookie.setMaxAge(/* ~4 mo. */9999999); // #762 rsp.addCookie(cookie); String ref = req.getHeader("Referer"); if (ref == null) { ref = "."; } rsp.sendRedirect2(ref); }
/** * Changes the icon size by changing the cookie */ public void doIconSize( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { String qs = req.getQueryString(); if(qs==null) throw new ServletException(); Cookie cookie = new Cookie("iconSize", Functions.validateIconSize(qs)); cookie.setMaxAge(/* ~4 mo. */9999999); // #762 rsp.addCookie(cookie); String ref = req.getHeader("Referer"); if(ref==null) ref="."; rsp.sendRedirect2(ref); }
/** * Checks if the user was successfully authenticated. * * @see BasicAuthenticationFilter */ public void doSecured( StaplerRequest req, StaplerResponse rsp ) throws IOException, ServletException { // TODO fire something in SecurityListener? (seems to be used only for REST calls when LegacySecurityRealm is active) if(req.getUserPrincipal()==null) { // authentication must have failed rsp.setStatus(HttpServletResponse.SC_UNAUTHORIZED); return; } // the user is now authenticated, so send him back to the target String path = req.getContextPath()+req.getOriginalRestOfPath(); String q = req.getQueryString(); if(q!=null) path += '?'+q; rsp.sendRedirect2(path); }
/** * Checks if the user was successfully authenticated. * * @see BasicAuthenticationFilter */ public void doSecured(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { if (req.getUserPrincipal() == null) { // authentication must have failed rsp.setStatus(HttpServletResponse.SC_UNAUTHORIZED); return; } // the user is now authenticated, so send him back to the target String path = req.getContextPath() + req.getOriginalRestOfPath(); String q = req.getQueryString(); if (q != null) { path += '?' + q; } rsp.sendRedirect2(path); }
/** * Checks if the user was successfully authenticated. * * @see BasicAuthenticationFilter */ public void doSecured(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { if (req.getUserPrincipal() == null) { // authentication must have failed rsp.setStatus(HttpServletResponse.SC_UNAUTHORIZED); return; } // the user is now authenticated, so send him back to the target String path = req.getContextPath() + req.getOriginalRestOfPath(); String q = req.getQueryString(); if (q != null) { path += '?' + q; } rsp.sendRedirect2(path); }
/** * Checks if the user was successfully authenticated. * * @see BasicAuthenticationFilter */ public void doSecured(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException { if (req.getUserPrincipal() == null) { // authentication must have failed rsp.setStatus(HttpServletResponse.SC_UNAUTHORIZED); return; } // the user is now authenticated, so send him back to the target String path = req.getContextPath() + req.getOriginalRestOfPath(); String q = req.getQueryString(); if (q != null) { path += '?' + q; } rsp.sendRedirect2(path); }
@Override public Object getDynamic(final String token, final StaplerRequest req, final StaplerResponse rsp) { try { final Build item = getRun(Combination.fromString(token)); if (item != null) { if (item.getNumber() == this.getNumber()) { return item; } else { // redirect the user to the correct URL String url = Functions.joinPath(item.getUrl(), req.getRestOfPath()); final String qs = req.getQueryString(); if (qs != null) { url += '?' + qs; } throw HttpResponses.redirectViaContextPath(url); } } } catch (final IllegalArgumentException e) { // failed to parse the token as Combination. Must be something else } return super.getDynamic(token, req, rsp); }
@Override public Object getDynamic(String token, StaplerRequest req, StaplerResponse rsp) { try { MatrixRun item = getRun(Combination.fromString(token)); if(item!=null) { if (item.getNumber()==this.getNumber()) return item; else { // redirect the user to the correct URL String url = Functions.joinPath(item.getUrl(), req.getRestOfPath()); String qs = req.getQueryString(); if (qs!=null) url+='?'+qs; throw HttpResponses.redirectViaContextPath(url); } } } catch (IllegalArgumentException ignored) { // failed to parse the token as Combination. Must be something else } return super.getDynamic(token,req,rsp); }