org.apache.cxf.jaxrs.client.WebClient.resetBaseAddress()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(2.0k)|赞(0)|评价(0)|浏览(91)

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

WebClient.resetBaseAddress介绍

暂无

代码示例

代码示例来源:origin: apache/cxf

/**
 * Moves WebClient to a new baseURI or forwards to new currentURI
 * @param newAddress new URI
 * @param forward if true then currentURI will be based on baseURI
 * @return updated WebClient
 */
public WebClient to(String newAddress, boolean forward) {
  getState().setTemplates(null);
  if (forward) {
    if (!newAddress.startsWith("/")
      && !newAddress.startsWith(getBaseURI().toString())) {
      throw new IllegalArgumentException("Base address can not be preserved");
    }
    resetCurrentBuilder(URI.create(newAddress));
  } else {
    resetBaseAddress(URI.create(newAddress));
  }
  return this;
}

代码示例来源:origin: org.apache.cxf/cxf-rt-rs-client

/**
 * Moves WebClient to a new baseURI or forwards to new currentURI
 * @param newAddress new URI
 * @param forward if true then currentURI will be based on baseURI
 * @return updated WebClient
 */
public WebClient to(String newAddress, boolean forward) {
  getState().setTemplates(null);
  if (forward) {
    if (!newAddress.startsWith("/")
      && !newAddress.startsWith(getBaseURI().toString())) {
      throw new IllegalArgumentException("Base address can not be preserved");
    }
    resetCurrentBuilder(URI.create(newAddress));
  } else {
    resetBaseAddress(URI.create(newAddress));
  }
  return this;
}

代码示例来源:origin: org.apache.cxf/cxf-bundle-jaxrs

/**
 * Moves WebClient to a new baseURI or forwards to new currentURI  
 * @param newAddress new URI
 * @param forward if true then currentURI will be based on baseURI  
 * @return updated WebClient
 */
public WebClient to(String newAddress, boolean forward) {
  getState().setTemplates(null);
  if (forward) {
    if (!newAddress.startsWith(getBaseURI().toString())) {
      throw new IllegalArgumentException("Base address can not be preserved");
    }
    resetCurrentBuilder(URI.create(newAddress));
  } else {
    resetBaseAddress(URI.create(newAddress));
  }
  return this;
}

相关文章

WebClient类方法