org.restlet.data.Reference.setScheme()方法的使用及代码示例

x33g5p2x  于2022-01-28 转载在 其他  
字(2.2k)|赞(0)|评价(0)|浏览(106)

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

Reference.setScheme介绍

[英]Sets the scheme component.
[中]设置方案组件。

代码示例

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

/**
 * Sets the scheme component based on this protocol.
 * 
 * @param protocol
 *            The protocol of the scheme component.
 */
public void setProtocol(Protocol protocol) {
  setScheme(protocol.getSchemeName());
}

代码示例来源:origin: org.restlet/org.restlet

/**
 * Sets the scheme component based on this protocol.
 * 
 * @param protocol
 *            The protocol of the scheme component.
 */
public void setProtocol(Protocol protocol) {
  setScheme(protocol.getSchemeName());
}

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Sets the scheme component based on this protocol.
 * 
 * @param protocol
 *            The protocol of the scheme component.
 */
public void setProtocol(Protocol protocol) {
  setScheme(protocol.getSchemeName());
}

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

setScheme(getScheme());
setHostDomain(getHostDomain());

代码示例来源:origin: org.restlet/org.restlet

setScheme(getScheme());
setHostDomain(getHostDomain());

代码示例来源:origin: org.restlet.osgi/org.restlet

setScheme(getScheme());
setHostDomain(getHostDomain());

代码示例来源:origin: org.restlet.osgi/org.restlet

/**
 * Returns the original reference especially by detecting potential proxy forwardings.
 * 
 * @param resourceRef
 *            The request's resource reference.
 * @param headers
 *            The set of request's headers.
 * @return The original reference.
 */
public static Reference getOriginalRef(Reference resourceRef, Series<Header> headers) {
  Reference originalRef = resourceRef.getTargetRef();
  if (headers == null) {
    return originalRef;
  }
  
  String value = headers.getFirstValue(HeaderConstants.HEADER_X_FORWARDED_PORT);
  if (value != null) {
    originalRef.setHostPort(Integer.parseInt(value));
  }
  value = headers.getFirstValue(HeaderConstants.HEADER_X_FORWARDED_PROTO);
  if (value != null) {
    originalRef.setScheme(value);
  }
  return originalRef;
}

代码示例来源:origin: org.restlet/org.restlet

result.setScheme(baseReference.getScheme());

代码示例来源:origin: DeviceConnect/DeviceConnect-Android

result.setScheme(baseReference.getScheme());

代码示例来源:origin: org.restlet.osgi/org.restlet

result.setScheme(baseReference.getScheme());

相关文章

Reference类方法