/** * If the given href link is matching the current page, return true. * * Used in {@code task.jelly} to decide if the page should be highlighted. */ public boolean hyperlinkMatchesCurrentPage(String href) throws UnsupportedEncodingException { String url = Stapler.getCurrentRequest().getRequestURL().toString(); if (href == null || href.length() <= 1) return ".".equals(href) && url.endsWith("/"); url = URLDecoder.decode(url,"UTF-8"); href = URLDecoder.decode(href,"UTF-8"); if (url.endsWith("/")) url = url.substring(0, url.length() - 1); if (href.endsWith("/")) href = href.substring(0, href.length() - 1); return url.endsWith(href); }
/** * This method captures the information of a request to terminate a computer instance. Method is public as * it needs to be called from {@link AbstractCloudSlave} and {@link jenkins.model.Nodes}. In general you should * not need to call this method directly, however if implementing a custom node type or a different path * for removing nodes, it may make sense to call this method in order to capture the originating request. * * @since 1.607 */ public void recordTermination() { StaplerRequest request = Stapler.getCurrentRequest(); if (request != null) { terminatedBy.add(new TerminationRequest( String.format("Termination requested at %s by %s [id=%d] from HTTP request for %s", new Date(), Thread.currentThread(), Thread.currentThread().getId(), request.getRequestURL() ) )); } else { terminatedBy.add(new TerminationRequest( String.format("Termination requested at %s by %s [id=%d]", new Date(), Thread.currentThread(), Thread.currentThread().getId() ) )); } }
StringBuffer reqUrl = req.getRequestURL(); if(reqUrl.charAt(reqUrl.length()-1)!='/') { rsp.sendRedirect2(reqUrl.append('/').toString());
/** * If the given href link is matching the current page, return true. * * Used in <tt>task.jelly</tt> to decide if the page should be highlighted. */ public boolean hyperlinkMatchesCurrentPage(String href) throws UnsupportedEncodingException { String url = Stapler.getCurrentRequest().getRequestURL().toString(); if (href == null || href.length() <= 1) return ".".equals(href) && url.endsWith("/"); url = URLDecoder.decode(url,"UTF-8"); href = URLDecoder.decode(href,"UTF-8"); if (url.endsWith("/")) url = url.substring(0, url.length() - 1); if (href.endsWith("/")) href = href.substring(0, href.length() - 1); return url.endsWith(href); }
/** * If the given href link is matching the current page, return true. * * Used in <tt>task.jelly</tt> to decide if the page should be highlighted. */ public boolean hyperlinkMatchesCurrentPage(String href) throws UnsupportedEncodingException { String url = Stapler.getCurrentRequest().getRequestURL().toString(); if (href == null || href.length() <= 1) return ".".equals(href) && url.endsWith("/"); url = URLDecoder.decode(url,"UTF-8"); href = URLDecoder.decode(href,"UTF-8"); if (url.endsWith("/")) url = url.substring(0, url.length() - 1); if (href.endsWith("/")) href = href.substring(0, href.length() - 1); return url.endsWith(href); }
/** * If the given href link is matching the current page, return true. * * Used in <tt>task.jelly</tt> to decide if the page should be highlighted. */ public boolean hyperlinkMatchesCurrentPage(String href) throws UnsupportedEncodingException { String url = Stapler.getCurrentRequest().getRequestURL().toString(); if (href == null || href.length() <= 1) return ".".equals(href) && url.endsWith("/"); url = URLDecoder.decode(url,"UTF-8"); href = URLDecoder.decode(href,"UTF-8"); if (url.endsWith("/")) url = url.substring(0, url.length() - 1); if (href.endsWith("/")) href = href.substring(0, href.length() - 1); return url.endsWith(href); }
/** * If the given href link is matching the current page, return true. * * Used in <tt>task.jelly</tt> to decide if the page should be highlighted. */ public boolean hyperlinkMatchesCurrentPage(String href) throws UnsupportedEncodingException { String url = Stapler.getCurrentRequest().getRequestURL().toString(); if (href == null || href.length() <= 1) return ".".equals(href) && url.endsWith("/"); url = URLDecoder.decode(url,"UTF-8"); href = URLDecoder.decode(href,"UTF-8"); if (url.endsWith("/")) url = url.substring(0, url.length() - 1); if (href.endsWith("/")) href = href.substring(0, href.length() - 1); return url.endsWith(href); }
/** * If the given href link is matching the current page, return true. * * Used in <tt>task.jelly</tt> to decide if the page should be highlighted. */ public boolean hyperlinkMatchesCurrentPage(String href) throws UnsupportedEncodingException { String url = Stapler.getCurrentRequest().getRequestURL().toString(); if (href == null || href.length() <= 1) { return ".".equals(href) && url.endsWith("/"); } url = URLDecoder.decode(url, "UTF-8"); href = URLDecoder.decode(href, "UTF-8"); if (url.endsWith("/")) { url = url.substring(0, url.length() - 1); } if (href.endsWith("/")) { href = href.substring(0, href.length() - 1); } return url.endsWith(href); }
/** * This method captures the information of a request to terminate a computer instance. Method is public as * it needs to be called from {@link AbstractCloudSlave} and {@link jenkins.model.Nodes}. In general you should * not need to call this method directly, however if implementing a custom node type or a different path * for removing nodes, it may make sense to call this method in order to capture the originating request. * * @since 1.607 */ public void recordTermination() { StaplerRequest request = Stapler.getCurrentRequest(); if (request != null) { terminatedBy.add(new TerminationRequest( String.format("Termination requested at %s by %s [id=%d] from HTTP request for %s", new Date(), Thread.currentThread(), Thread.currentThread().getId(), request.getRequestURL() ) )); } else { terminatedBy.add(new TerminationRequest( String.format("Termination requested at %s by %s [id=%d]", new Date(), Thread.currentThread(), Thread.currentThread().getId() ) )); } }
/** * When the identity provider is done with its thing, the user comes back here. */ public HttpResponse doFinishLogin(StaplerRequest request) throws IOException { StringBuffer buf = request.getRequestURL(); if (request.getQueryString() != null) { buf.append('?').append(request.getQueryString()); } AuthorizationCodeResponseUrl responseUrl = new AuthorizationCodeResponseUrl(buf.toString()); if (! uuid.equals(responseUrl.getState())) { return HttpResponses.error(401, "State is invalid"); } String code = responseUrl.getCode(); if (responseUrl.getError() != null) { return HttpResponses.error(401, "Error from provider: " + code); } else if (code == null) { return HttpResponses.error(404, "Missing authorization code"); } else { return onSuccess(code); } }
StringBuffer reqUrl = req.getRequestURL(); if(reqUrl.charAt(reqUrl.length()-1)!='/') { rsp.sendRedirect2(reqUrl.append('/').toString());
StringBuffer reqUrl = req.getRequestURL(); if(reqUrl.charAt(reqUrl.length()-1)!='/') { rsp.sendRedirect2(reqUrl.append('/').toString());
StringBuffer reqUrl = req.getRequestURL(); if(reqUrl.charAt(reqUrl.length()-1)!='/') { rsp.sendRedirect2(reqUrl.append('/').toString());
StringBuffer reqUrl = req.getRequestURL(); if (reqUrl.charAt(reqUrl.length() - 1) != '/') { rsp.sendRedirect2(reqUrl.append('/').toString());
StringBuffer reqUrl = req.getRequestURL(); if(reqUrl.charAt(reqUrl.length()-1)!='/') { rsp.sendRedirect2(reqUrl.append('/').toString());