提交 37625d67 编写于 作者: K Kohsuke Kawaguchi

added a convenience method

上级 f89ff9ac
......@@ -292,7 +292,18 @@ public abstract class Descriptor<T extends Describable<T>> implements Saveable {
return "descriptorByName/"+getId();
}
private String getCurrentDescriptorByNameUrl() {
/**
* Gets the URL that this Descriptor is bound to, relative to the context path.
* @since 1.406
*/
public final String getDescriptorFullUrl() {
return getCurrentDescriptorByNameUrl()+'/'+getDescriptorUrl();
}
/**
* @since 1.402
*/
public static String getCurrentDescriptorByNameUrl() {
StaplerRequest req = Stapler.getCurrentRequest();
Ancestor a = req.findAncestor(DescriptorByNameOwner.class);
return a.getUrl();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册