/** * @since 1.402 */ public static String getCurrentDescriptorByNameUrl() { StaplerRequest req = Stapler.getCurrentRequest(); // this override allows RenderOnDemandClosure to preserve the proper value Object url = req.getAttribute("currentDescriptorByNameUrl"); if (url!=null) return url.toString(); Ancestor a = req.findAncestor(DescriptorByNameOwner.class); return a.getUrl(); }
AbstractBuild build = (AbstractBuild)request.findAncestor(AbstractBuild.class).getObject(); File fileParameter = getLocationUnderBuild(build);
private Job<?, ?> retrieveCurrentJob() { StaplerRequest request = Stapler.getCurrentRequest(); if (request != null) { Ancestor ancestor = request.findAncestor(Job.class); return ancestor == null ? null : (Job<?, ?>) ancestor.getObject(); } return null; }
Ancestor ancestor = Stapler.getCurrentRequest().findAncestor(BoundObjectTable.class); if (ancestor == null) { throw new IllegalStateException("no BoundObjectTable");
/** * @see ContextMenuVisibility */ public ContextMenu add(Action a) { if (!Functions.isContextMenuVisible(a)) { return this; } StaplerRequest req = Stapler.getCurrentRequest(); String text = a.getDisplayName(); String base = Functions.getIconFilePath(a); if (base==null) return this; String icon = Stapler.getCurrentRequest().getContextPath()+(base.startsWith("images/")?Functions.getResourcePath():"")+'/'+base; String url = Functions.getActionUrl(req.findAncestor(ModelObject.class).getUrl(),a); return add(url,icon,text); }
protected void redirectAncestor(final StaplerRequest req, final StaplerResponse resp, final Object obj) throws IOException { log.trace("Redirect ancestor: {}", obj); Ancestor ancestor = req.findAncestor(obj); redirect(req, resp, ancestor.getUrl()); }
protected void redirectAncestor(final StaplerRequest req, final StaplerResponse resp, final Object obj) throws IOException { log.trace("Redirect ancestor: {}", obj); Ancestor ancestor = req.findAncestor(obj); redirect(req, resp, ancestor.getUrl()); }
protected void redirectAncestor(final StaplerRequest req, final StaplerResponse resp, final Object obj) throws IOException { log.trace("Redirect ancestor: {}", obj); Ancestor ancestor = req.findAncestor(obj); redirect(req, resp, ancestor.getUrl()); }
protected void redirectAncestor(final StaplerRequest req, final StaplerResponse resp, final Class type) throws IOException { log.trace("Redirect ancestor: {}", type); redirect(req, resp, req.findAncestor(type).getUrl()); }
protected void redirectAncestor(final StaplerRequest req, final StaplerResponse resp, final Class type) throws IOException { log.trace("Redirect ancestor: {}", type); redirect(req, resp, req.findAncestor(type).getUrl()); }
protected void redirectAncestor(final StaplerRequest req, final StaplerResponse resp, final Class type) throws IOException { log.trace("Redirect ancestor: {}", type); redirect(req, resp, req.findAncestor(type).getUrl()); }
private String getCurrentDescriptorByNameUrl() { StaplerRequest req = Stapler.getCurrentRequest(); Ancestor a = req.findAncestor(DescriptorByNameOwner.class); return Functions.getAncestorUrl(req, a); }
private String getCurrentDescriptorByNameUrl() { StaplerRequest req = Stapler.getCurrentRequest(); Ancestor a = req.findAncestor(DescriptorByNameOwner.class); return a.getUrl(); }
private String getCurrentDescriptorByNameUrl() { StaplerRequest req = Stapler.getCurrentRequest(); Ancestor a = req.findAncestor(DescriptorByNameOwner.class); return a.getUrl(); }
private String getCurrentDescriptorByNameUrl() { StaplerRequest req = Stapler.getCurrentRequest(); Ancestor a = req.findAncestor(DescriptorByNameOwner.class); return a.getUrl(); }
/** * @since 1.402 */ public static String getCurrentDescriptorByNameUrl() { StaplerRequest req = Stapler.getCurrentRequest(); // this override allows RenderOnDemandClosure to preserve the proper value Object url = req.getAttribute("currentDescriptorByNameUrl"); if (url!=null) return url.toString(); Ancestor a = req.findAncestor(DescriptorByNameOwner.class); return a.getUrl(); }
/** * Called from within the request handling of a bound object, to release the object explicitly. */ public void releaseMe() { Ancestor eot = Stapler.getCurrentRequest().findAncestor(BoundObjectTable.class); if (eot==null) throw new IllegalStateException("The thread is not handling a request to a abound object"); String id = eot.getNextToken(0); resolve(false).release(id); // resolve(false) can't fail because we are processing this request now. }
/** * Called from within the request handling of a bound object, to release the object explicitly. */ public void releaseMe() { Ancestor eot = Stapler.getCurrentRequest().findAncestor(BoundObjectTable.class); if (eot==null) throw new IllegalStateException("The thread is not handling a request to a abound object"); String id = eot.getNextToken(0); resolve(false).release(id); // resolve(false) can't fail because we are processing this request now. }
/** * Called from within the request handling of a bound object, to release the object explicitly. */ public void releaseMe() { Ancestor eot = Stapler.getCurrentRequest().findAncestor(BoundObjectTable.class); if (eot==null) throw new IllegalStateException("The thread is not handling a request to a abound object"); String id = eot.getNextToken(0); resolve(false).release(id); // resolve(false) can't fail because we are processing this request now. }
@Override public void doDynamic(StaplerRequest req, StaplerResponse res) throws ServletException, IOException { if (("/" + getOriginalFileName()).equals(req.getRestOfPath())) { AbstractBuild build = (AbstractBuild) req .findAncestor(AbstractBuild.class) .getObject(); File fileParameter = getLocationUnderBuild(build); if (fileParameter.isFile()) { res.serveFile(req, fileParameter.toURI().toURL()); } } }