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

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

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

Reference.getScheme介绍

[英]Returns the scheme component.
Note that no URI decoding is done by this method.
[中]返回scheme组件。
请注意,此方法不会执行URI解码。

代码示例

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

/**
 * Indicates if the reference is absolute.
 * 
 * @return True if the reference is absolute.
 */
public boolean isAbsolute() {
  return (getScheme() != null);
}

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

/**
 * Indicates if the reference is absolute.
 * 
 * @return True if the reference is absolute.
 */
public boolean isAbsolute() {
  return (getScheme() != null);
}

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

/**
 * Indicates if the reference is relative.
 * 
 * @return True if the reference is relative.
 */
public boolean isRelative() {
  return (getScheme() == null);
}

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

/**
 * Indicates if the reference is relative.
 * 
 * @return True if the reference is relative.
 */
public boolean isRelative() {
  return (getScheme() == null);
}

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

/**
 * Indicates if the reference is absolute.
 * 
 * @return True if the reference is absolute.
 */
public boolean isAbsolute() {
  return (getScheme() != null);
}

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

/**
 * Indicates if the reference is relative.
 * 
 * @return True if the reference is relative.
 */
public boolean isRelative() {
  return (getScheme() == null);
}

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

/**
 * Returns the optionnally decoded scheme component.
 * 
 * @param decode
 *            Indicates if the result should be decoded using the
 *            {@link #decode(String)} method.
 * @return The optionnally decoded scheme component.
 * @see #getScheme()
 */
public String getScheme(boolean decode) {
  return decode ? decode(getScheme()) : getScheme();
}

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

/**
 * Returns the optionnally decoded scheme component.
 * 
 * @param decode
 *            Indicates if the result should be decoded using the {@link #decode(String)} method.
 * @return The optionnally decoded scheme component.
 * @see #getScheme()
 */
public String getScheme(boolean decode) {
  return decode ? decode(getScheme()) : getScheme();
}

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

/**
 * Returns the optionnally decoded scheme component.
 * 
 * @param decode
 *            Indicates if the result should be decoded using the
 *            {@link #decode(String)} method.
 * @return The optionnally decoded scheme component.
 * @see #getScheme()
 */
public String getScheme(boolean decode) {
  return decode ? decode(getScheme()) : getScheme();
}

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

/**
 * Returns the host identifier. Includes the scheme, the host name and the
 * host port number.<br>
 * Note that no URI decoding is done by this method.
 * 
 * @return The host identifier.
 */
public String getHostIdentifier() {
  final StringBuilder result = new StringBuilder();
  result.append(getScheme()).append("://").append(getAuthority());
  return result.toString();
}

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

/**
 * Returns the protocol associated with the scheme component.
 * 
 * @return The protocol associated with the scheme component.
 */
public Protocol getSchemeProtocol() {
  return Protocol.valueOf(getScheme());
}

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

/**
 * Returns the protocol associated with the scheme component.
 * 
 * @return The protocol associated with the scheme component.
 */
public Protocol getSchemeProtocol() {
  return Protocol.valueOf(getScheme());
}

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

/**
 * Returns the host identifier. Includes the scheme, the host name and the
 * host port number.<br>
 * Note that no URI decoding is done by this method.
 * 
 * @return The host identifier.
 */
public String getHostIdentifier() {
  final StringBuilder result = new StringBuilder();
  result.append(getScheme()).append("://").append(getAuthority());
  return result.toString();
}

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

/**
 * Returns the protocol associated with the scheme component.
 * 
 * @return The protocol associated with the scheme component.
 */
public Protocol getSchemeProtocol() {
  return Protocol.valueOf(getScheme());
}

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

/**
 * Returns the host identifier. Includes the scheme, the host name and the
 * host port number.<br>
 * Note that no URI decoding is done by this method.
 * 
 * @return The host identifier.
 */
public String getHostIdentifier() {
  final StringBuilder result = new StringBuilder();
  result.append(getScheme()).append("://").append(getAuthority());
  return result.toString();
}

代码示例来源: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: com.whizzosoftware.hobson.hub/hobson-hub-setup

public void handle(Request request, Response response) {
    if (request.getResourceRef().getScheme().equalsIgnoreCase("clap")) {
      request.getAttributes().put("org.restlet.clap.classLoader", bundleClassLoader);
    }
    dispatcher.handle(request, response);
  }
}

代码示例来源: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.");
  }
}

相关文章

Reference类方法