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

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

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

Protocol.equals介绍

暂无

代码示例

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

/**
 * Returns the JAR entry path.
 * 
 * @return The JAR entry path.
 */
public String getJarEntryPath() {
  String result = null;
  if (getSchemeProtocol().equals(Protocol.JAR)) {
    final String ssp = getSchemeSpecificPart();
    if (ssp != null) {
      final int separatorIndex = ssp.indexOf("!/");
      if (separatorIndex != -1) {
        result = ssp.substring(separatorIndex + 2);
      }
    }
  }
  return result;
}

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

/**
 * Returns the JAR entry path.
 * 
 * @return The JAR entry path.
 */
public String getJarEntryPath() {
  String result = null;
  if (Protocol.JAR.equals(getSchemeProtocol())) {
    final String ssp = getSchemeSpecificPart();
    if (ssp != null) {
      final int separatorIndex = ssp.indexOf("!/");
      if (separatorIndex != -1) {
        result = ssp.substring(separatorIndex + 2);
      }
    }
  }
  return result;
}

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

/**
 * Returns the JAR file reference.
 * 
 * @return The JAR file reference.
 */
public Reference getJarFileRef() {
  Reference result = null;
  if (getSchemeProtocol().equals(Protocol.JAR)) {
    final String ssp = getSchemeSpecificPart();
    if (ssp != null) {
      final int separatorIndex = ssp.indexOf("!/");
      if (separatorIndex != -1) {
        result = new Reference(ssp.substring(0, separatorIndex));
      }
    }
  }
  return result;
}

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

/**
 * Returns the JAR file reference.
 * 
 * @return The JAR file reference.
 */
public Reference getJarFileRef() {
  Reference result = null;
  if (Protocol.JAR.equals(getSchemeProtocol())) {
    final String ssp = getSchemeSpecificPart();
    if (ssp != null) {
      final int separatorIndex = ssp.indexOf("!/");
      if (separatorIndex != -1) {
        result = new Reference(ssp.substring(0, separatorIndex));
      }
    }
  }
  return result;
}

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

/**
 * Gets the local file corresponding to the reference. Only URIs referring
 * to the "localhost" or to an empty authority are supported.
 * 
 * @return The local file corresponding to the reference.
 */
public File getFile() {
  File result = null;
  if (Protocol.FILE.equals(getSchemeProtocol())) {
    final String hostName = getAuthority();
    if ((hostName == null) || hostName.equals("")
        || hostName.equalsIgnoreCase("localhost")) {
      final String filePath = Reference.decode(getPath());
      result = new File(filePath);
    } else {
      throw new RuntimeException(
          "Can't resolve files on remote host machines");
    }
  }
  return result;
}

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

/**
 * Gets the local file corresponding to the reference. Only URIs referring
 * to the "localhost" or to an empty authority are supported.
 * 
 * @return The local file corresponding to the reference.
 */
public File getFile() {
  File result = null;
  if (getSchemeProtocol().equals(Protocol.FILE)) {
    final String hostName = getAuthority();
    if ((hostName == null) || hostName.equals("")
        || hostName.equalsIgnoreCase("localhost")) {
      final String filePath = Reference.decode(getPath());
      result = new File(filePath);
    } else {
      throw new RuntimeException(
          "Can't resolve files on remote host machines");
    }
  }
  return result;
}

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

/**
 * Returns the type of authority.
 * 
 * @return The type of authority.
 */
public int getClapAuthorityType() {
  int result = 0;
  if (getSchemeProtocol().equals(Protocol.CLAP)) {
    final String authority = getAuthority();
    if (authority != null) {
      if (authority.equalsIgnoreCase(getAuthorityName(CLAP_CLASS))) {
        result = CLAP_CLASS;
      } else if (authority
          .equalsIgnoreCase(getAuthorityName(CLAP_SYSTEM))) {
        result = CLAP_SYSTEM;
      } else if (authority
          .equalsIgnoreCase(getAuthorityName(CLAP_THREAD))) {
        result = CLAP_THREAD;
      }
    }
  }
  return result;
}

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

/**
 * Returns the type of authority.
 * 
 * @return The type of authority.
 */
public int getRiapAuthorityType() {
  int result = 0;
  if (getSchemeProtocol().equals(Protocol.RIAP)) {
    final String authority = getAuthority();
    if (authority != null) {
      if (authority
          .equalsIgnoreCase(getAuthorityName(RIAP_APPLICATION))) {
        result = RIAP_APPLICATION;
      } else if (authority
          .equalsIgnoreCase(getAuthorityName(RIAP_COMPONENT))) {
        result = RIAP_COMPONENT;
      } else if (authority
          .equalsIgnoreCase(getAuthorityName(RIAP_HOST))) {
        result = RIAP_HOST;
      }
    }
  }
  return result;
}

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

/**
 * Returns the type of authority.
 * 
 * @return The type of authority.
 */
public int getClapAuthorityType() {
  int result = 0;
  if (Protocol.CLAP.equals(getSchemeProtocol())) {
    final String authority = getAuthority();
    if (authority != null) {
      if (authority.equalsIgnoreCase(getAuthorityName(CLAP_CLASS))) {
        result = CLAP_CLASS;
      } else if (authority
          .equalsIgnoreCase(getAuthorityName(CLAP_SYSTEM))) {
        result = CLAP_SYSTEM;
      } else if (authority
          .equalsIgnoreCase(getAuthorityName(CLAP_THREAD))) {
        result = CLAP_THREAD;
      } else {
        result = CLAP_DEFAULT;
      }
    }
  }
  return result;
}

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

/**
 * Returns the type of authority.
 * 
 * @return The type of authority.
 */
public int getRiapAuthorityType() {
  int result = 0;
  if (Protocol.RIAP.equals(getSchemeProtocol())) {
    final String authority = getAuthority();
    if (authority != null) {
      if (authority
          .equalsIgnoreCase(getAuthorityName(RIAP_APPLICATION))) {
        result = RIAP_APPLICATION;
      } else if (authority
          .equalsIgnoreCase(getAuthorityName(RIAP_COMPONENT))) {
        result = RIAP_COMPONENT;
      } else if (authority
          .equalsIgnoreCase(getAuthorityName(RIAP_HOST))) {
        result = RIAP_HOST;
      }
    }
  }
  return result;
}

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

if (Protocol.FILE.equals(fileRef.getSchemeProtocol())) {
  final File file = fileRef.getFile();
  if (Method.GET.equals(request.getMethod())

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

@Override
public void handle(Request request, Response response) {
  try {
    if (Protocol.FTP.equals(request.getProtocol())) {
      if (Method.GET.equals(request.getMethod())) {
        Reference ftpRef = request.getResourceRef();

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

@Override
public void handle(Request request, Response response) {
  try {
    if (Protocol.FTP.equals(request.getProtocol())) {
      if (Method.GET.equals(request.getMethod())) {
        Reference ftpRef = request.getResourceRef();

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

@Override
public void handle(Request request, Response response) {
  try {
    if (Protocol.FTP.equals(request.getProtocol())) {
      if (Method.GET.equals(request.getMethod())) {
        Reference ftpRef = request.getResourceRef();

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

Protocol protocol = request.getProtocol();
if (protocol.equals(Protocol.RIAP)) {

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

if (xmlConfigReference != null) {
  Protocol protocol = xmlConfigReference.getSchemeProtocol();
  if (Protocol.FILE.equals(protocol)) {

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

if (protocol.equals(Protocol.RIAP)) {

相关文章