added the shortUrl() method.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@1874 71c3de6d-444a-0410-be80-ed276b4c234a
This commit is contained in:
kohsuke committed 2007-01-22 06:07:33 +00:00
1 parent 8a7575fdc0
commit 277fa849ff
3 files changed
+16 -6

No files matched your search

@@ -107,7 +107,11 @@ public abstract class AbstractItem extends Actionable implements Item {
}
public final String getUrl() {
return getParent().getUrl()+getParent().getUrlChildPrefix()+'/'+getName()+'/';
return getParent().getUrl()+getShortUrl();
}
public String getShortUrl() {
return getParent().getUrlChildPrefix()+'/'+getName()+'/';
}
/**
+7 -1
View File
@@ -69,12 +69,18 @@ public interface Item extends PersistenceRoot {
String getFullName();
/**
* Returns the URL of this project relative to the context root of the application.
* Returns the URL of this item relative to the context root of the application.
*
* @see AbstractItem#getUrl() for how to implement this.
*/
String getUrl();
/**
* Returns the URL of this item relative to the parent {@link ItemGroup}.
* @see AbstractItem#getShortUrl() for how to implement this.
*/
String getShortUrl();
/**
* Called right after when a {@link Item} is loaded from disk.
* This is an opporunity to do a post load processing.