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

x33g5p2x  于2022-01-26 转载在 其他  
字(7.3k)|赞(0)|评价(0)|浏览(152)

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

Protocol.getSchemeName介绍

[英]Returns the URI scheme name.
[中]返回URI方案名称。

代码示例

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

/**
 * Constructor for a protocol, host name and host port
 * 
 * @param protocol
 *            Protocol/scheme to use
 * @param hostName
 *            The host name or IP address.
 * @param hostPort
 *            The host port (default ports are correctly ignored).
 */
public Reference(Protocol protocol, String hostName, int hostPort) {
  this(protocol.getSchemeName(), hostName, hostPort, null, null, null);
}

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

/**
 * Constructor for a protocol, host name and host port
 * 
 * @param protocol
 *            Protocol/scheme to use
 * @param hostName
 *            The host name or IP address.
 * @param hostPort
 *            The host port (default ports are correctly ignored).
 */
public Reference(Protocol protocol, String hostName, int hostPort) {
  this(protocol.getSchemeName(), hostName, hostPort, null, null, null);
}

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

/**
 * Constructor for a protocol, host name and host port
 * 
 * @param protocol
 *            Protocol/scheme to use
 * @param hostName
 *            The host name or IP address.
 * @param hostPort
 *            The host port (default ports are correctly ignored).
 */
public Reference(Protocol protocol, String hostName, int hostPort) {
  this(protocol.getSchemeName(), hostName, hostPort, null, null, null);
}

代码示例来源: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

/**
 * 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

@Override
protected void handleLocal(Request request, Response response,
    String decodedPath) {
  String scheme = request.getResourceRef().getScheme();
  if (!FILE.getSchemeName().equalsIgnoreCase(scheme)) {
    throw new IllegalArgumentException(format(
        "Protocol \"%s\" not supported by the connector. Only FILE is supported.", scheme));
  }
  handleFile(request, response, decodedPath);
}

代码示例来源:origin: com.noelios.restlet/com.noelios.restlet.ext.servlet

@Override
public void handle(Request request, Response response) {
  final String scheme = request.getResourceRef().getScheme();
  if (Protocol.WAR.getSchemeName().equalsIgnoreCase(scheme)) {
    super.handle(request, response);
  } else {
    throw new IllegalArgumentException(
        "Protocol \""
            + scheme
            + "\" not supported by the connector. Only WAR is supported.");
  }
}

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

@Override
public void handle(Request request, Response response) {
  final String scheme = request.getResourceRef().getScheme();
  if (Protocol.WAR.getSchemeName().equalsIgnoreCase(scheme)) {
    super.handle(request, response);
  } else {
    throw new IllegalArgumentException(
        "Protocol \""
            + scheme
            + "\" not supported by the connector. Only WAR is supported.");
  }
}

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

@Override
protected void handleLocal(Request request, Response response,
    String decodedPath) {
  String scheme = request.getResourceRef().getScheme();
  if (scheme.equalsIgnoreCase(Protocol.OBAP.getSchemeName())) {
    Bundle bundle = BUNDLE_CACHE.get(request.getResourceRef()
        .getAuthority());
    getLogger().fine(
        "Look for bundle "
            + request.getResourceRef().getAuthority());
    handleBundle(request, response, bundle);
  } else {
    throw new IllegalArgumentException(
        "Protocol \""
            + scheme
            + "\" not supported by the connector. Only OBAP is supported.");
  }
}

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

String scheme = request.getResourceRef().getScheme();
if (scheme.equalsIgnoreCase(Protocol.CLAP.getSchemeName())) {
  LocalReference cr = new LocalReference(request.getResourceRef());
  ClassLoader classLoader = null;

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

String scheme = getOriginalRef().getScheme();
if (!Protocol.RIAP.getSchemeName().equals(scheme)) {
  throw new ResourceException(Status.CLIENT_ERROR_BAD_REQUEST,
      "Auth server only allows local resource validation");

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

Endpoint endpoint = new Endpoint(baseRef.getHostDomain(),
    baseRef.getHostPort(), baseRef.getSchemeProtocol()
        .getSchemeName(), baseRef.getPath(), scheme);
definition.getEndpoints().add(endpoint);
    Protocol.HTTP.getSchemeName(), "/v1", scheme);
definition.getEndpoints().add(endpoint);

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

Endpoint endpoint = new Endpoint(baseRef.getHostDomain(),
    baseRef.getHostPort(), baseRef.getSchemeProtocol()
        .getSchemeName(), baseRef.getPath(), scheme);
definition.getEndpoints().add(endpoint);
    Protocol.HTTP.getSchemeName(), "/v1", scheme);
definition.getEndpoints().add(endpoint);

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

Endpoint endpoint = new Endpoint(baseRef.getHostDomain(),
    baseRef.getHostPort(), baseRef.getSchemeProtocol()
        .getSchemeName(), baseRef.getPath(), scheme);
definition.getEndpoints().add(endpoint);
    Protocol.HTTP.getSchemeName(), "/v1", scheme);
definition.getEndpoints().add(endpoint);

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

Endpoint endpoint = new Endpoint(baseRef.getHostDomain(),
    baseRef.getHostPort(), baseRef.getSchemeProtocol()
        .getSchemeName(), baseRef.getPath(), scheme);
definition.getEndpoints().add(endpoint);
    Protocol.HTTP.getSchemeName(), "/v1", scheme);
definition.getEndpoints().add(endpoint);

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

Endpoint endpoint = new Endpoint(baseRef.getHostDomain(),
    baseRef.getHostPort(), baseRef.getSchemeProtocol()
        .getSchemeName(), baseRef.getPath(), scheme);
definition.getEndpoints().add(endpoint);
    Protocol.HTTP.getSchemeName(), "/v1", scheme);
definition.getEndpoints().add(endpoint);

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

/**
 * Creates the protocol associated to a URI scheme name. If an existing
 * constant exists then it is returned, otherwise a new instance is created.
 * 
 * @param name
 *            The scheme name.
 * @param version
 *            The version number.
 * @return The associated protocol.
 */
public static Protocol valueOf(String name, String version) {
  Protocol result = valueOf(name);
  if (!version.equals(result.getVersion())) {
    result = new Protocol(result.getSchemeName(), result.getName(),
        result.getTechnicalName(), result.getDescription(),
        result.getDefaultPort(), result.isConfidential(), version);
  }
  return result;
}

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

/**
 * Creates the protocol associated to a URI scheme name. If an existing
 * constant exists then it is returned, otherwise a new instance is created.
 * 
 * @param name
 *            The scheme name.
 * @param version
 *            The version number.
 * @return The associated protocol.
 */
public static Protocol valueOf(String name, String version) {
  Protocol result = valueOf(name);
  if (!version.equals(result.getVersion())) {
    result = new Protocol(result.getSchemeName(), result.getName(),
        result.getTechnicalName(), result.getDescription(),
        result.getDefaultPort(), result.isConfidential(), version);
  }
  return result;
}

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

final String scheme = request.getResourceRef().getScheme();
if (Protocol.RIAP.getSchemeName().equalsIgnoreCase(scheme)) {

相关文章