mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-16 21:42:27 +00:00
added a convenience method
This commit is contained in:
1 parent
f89ff9ac8c
commit
37625d67bb
1 file changed
+12
-1
@@ -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();
|
||||
|
||||
Reference in new issue
Block a user