hudson.model.Item.getUrl()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(133)

本文整理了Java中hudson.model.Item.getUrl()方法的一些代码示例,展示了Item.getUrl()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Item.getUrl()方法的具体详情如下:
包路径:hudson.model.Item
类名称:Item
方法名:getUrl

Item.getUrl介绍

[英]Returns the URL of this item relative to the context root of the application.
[中]返回此项相对于应用程序的上下文根的URL。

代码示例

代码示例来源:origin: jenkinsci/jenkins

public static String encodeTo(Item item, String text) {
  return encodeTo('/'+item.getUrl(),text);
}

代码示例来源:origin: jenkinsci/jenkins

/**
 * Returns the absolute URL of this item. This relies on the current
 * {@link StaplerRequest} to figure out what the host name is,
 * so can be used only during processing client requests.
 *
 * @return
 *      absolute URL.
 * @throws IllegalStateException
 *      if the method is invoked outside the HTTP request processing.
 *
 * @deprecated
 *      This method shall <b>NEVER</b> be used during HTML page rendering, as it won't work with
 *      network set up like Apache reverse proxy.
 *      This method is only intended for the remote API clients who cannot resolve relative references
 *      (even this won't work for the same reason, which should be fixed.)
 */
@Deprecated
default String getAbsoluteUrl() {
  String r = Jenkins.getInstance().getRootUrl();
  if(r==null)
    throw new IllegalStateException("Root URL isn't configured yet. Cannot compute absolute URL.");
  return Util.encode(r+getUrl());
}

代码示例来源:origin: jenkinsci/jenkins

} else {
  return normalizeURI(request.getContextPath()+'/'+p.getUrl());

代码示例来源:origin: jenkinsci/build-failure-analyzer-plugin

@Override
  protected String getOwnerUrl() {
    return "/" + owner.getUrl();
  }
}

代码示例来源:origin: org.jenkins-ci.plugins/config-file-provider

private static String getDetailsLink(StaplerRequest req, Item context, String fileId) {
  String link = req.getContextPath();
  link = StringUtils.isNotBlank(context.getUrl()) ? link + "/" + context.getUrl() : link;
  link = link + "configfiles/show?id=" + fileId;
  String linkHtml = "<a target=\"_blank\" href=\"" + link + "\">view selected file</a>";
  // 1x16 spacer needed for IE since it doesn't support min-height
  return "<div class='ok'><img src='" +
      req.getContextPath() + Jenkins.RESOURCE_PATH + "/images/none.gif' height=16 width=1>" +
      linkHtml + "</div>";
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-test-harness

public HtmlPage getPage(Item item, String relative) throws IOException, SAXException {
  return goTo(item.getUrl()+relative);
}

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

public static String encodeTo(Item item, String text) {
  return encodeTo('/'+item.getUrl(),text);
}

代码示例来源:origin: jenkinsci/jenkins-test-harness

public HtmlPage getPage(Item item, String relative) throws IOException, SAXException {
  return goTo(item.getUrl()+relative);
}

代码示例来源:origin: org.eclipse.hudson/hudson-test-framework

public HtmlPage getPage(Item item, String relative) throws IOException, SAXException {
  return goTo(item.getUrl() + relative);
}

代码示例来源:origin: jenkinsci/jenkins-test-harness

public HtmlPage getPage(Item item, String relative) throws IOException, SAXException {
  return goTo(item.getUrl()+relative);
}

代码示例来源:origin: org.jvnet.hudson.main/hudson-test-framework

public HtmlPage getPage(Item item, String relative) throws IOException, SAXException {
  return goTo(item.getUrl()+relative);
}

代码示例来源:origin: org.jenkins-ci.plugins/pubsub-light

/**
 * Set {@link Item} propertis on the message instance.
 * @param item The Jenkins {@link Item}.
 */
protected T setItemProps(@Nonnull Item item) {
  set(EventProps.Jenkins.jenkins_object_name, item.getFullName());
  set(EventProps.Jenkins.jenkins_object_url, item.getUrl());
  return (T) this;
}

代码示例来源:origin: jenkinsci/workflow-cps-plugin

toAppend.append(u);
} else {
  toAppend.append(i.getUrl());
  if (!i.getUrl().endsWith("/")) {
    toAppend.append("/");

代码示例来源:origin: stackoverflow.com

holder.imageView.setImageUrl(item.getImage(), imageLoader);
holder.news_text.setText(item.getNews_text());
holder.news_url.setText(item.getUrl());
holder.time_stamp.setText(item.getTime_stamp());
holder.news_title.setText(item.getNews_title());

代码示例来源:origin: org.eclipse.hudson.main/hudson-core

} else {
  return request.getContextPath()+'/'+p.getUrl();

代码示例来源:origin: org.jvnet.hudson.main/hudson-core

} else {
  return request.getContextPath()+'/'+p.getUrl();

代码示例来源:origin: hudson/hudson-2.x

} else {
  return request.getContextPath()+'/'+p.getUrl();

代码示例来源:origin: org.eclipse.hudson/hudson-core

} else {
  return getRequestRootPath(request) + '/' + p.getUrl();

代码示例来源:origin: org.jenkins-ci.main/jenkins-core

} else {
  return normalizeURI(request.getContextPath()+'/'+p.getUrl());

相关文章