org.apache.tomcat.util.net.URL.compare()方法的使用及代码示例

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

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

URL.compare介绍

[英]Compare to String values for equality, taking appropriate care if one or both of the values are null.
[中]比较字符串值是否相等,如果其中一个或两个值均为null,请适当注意。

代码示例

代码示例来源:origin: org.jboss.web/jbossweb

/**
 * Compare two URLs, excluding the "ref" fields.  Returns <code>true</code>
 * if this <code>URL</code> and the <code>other</code> argument both refer
 * to the same resource.  The two <code>URLs</code> might not both contain
 * the same anchor.
 */
public boolean sameFile(URL other) {
  if (!compare(protocol, other.getProtocol()))
    return (false);
  if (!compare(host, other.getHost()))
    return (false);
  if (port != other.getPort())
    return (false);
  if (!compare(file, other.getFile()))
    return (false);
  return (true);
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

/**
 * Compare two URLs, excluding the "ref" fields.  Returns <code>true</code>
 * if this <code>URL</code> and the <code>other</code> argument both refer
 * to the same resource.  The two <code>URLs</code> might not both contain
 * the same anchor.
 */
public boolean sameFile(URL other) {
  if (!compare(protocol, other.getProtocol()))
    return (false);
  if (!compare(host, other.getHost()))
    return (false);
  if (port != other.getPort())
    return (false);
  if (!compare(file, other.getFile()))
    return (false);
  return (true);
}

代码示例来源:origin: org.apache.coyote.springsource/com.springsource.org.apache.coyote.springsource

/**
 * Compare two URLs, excluding the "ref" fields.  Returns <code>true</code>
 * if this <code>URL</code> and the <code>other</code> argument both refer
 * to the same resource.  The two <code>URLs</code> might not both contain
 * the same anchor.
 */
public boolean sameFile(URL other) {
  if (!compare(protocol, other.getProtocol()))
    return (false);
  if (!compare(host, other.getHost()))
    return (false);
  if (port != other.getPort())
    return (false);
  if (!compare(file, other.getFile()))
    return (false);
  return (true);
}

代码示例来源:origin: org.apache.coyote/com.springsource.org.apache.coyote

/**
 * Compare two URLs, excluding the "ref" fields.  Returns <code>true</code>
 * if this <code>URL</code> and the <code>other</code> argument both refer
 * to the same resource.  The two <code>URLs</code> might not both contain
 * the same anchor.
 */
public boolean sameFile(URL other) {
  if (!compare(protocol, other.getProtocol()))
    return (false);
  if (!compare(host, other.getHost()))
    return (false);
  if (port != other.getPort())
    return (false);
  if (!compare(file, other.getFile()))
    return (false);
  return (true);
}

代码示例来源:origin: jboss.web/jbossweb

/**
 * Compare two URLs, excluding the "ref" fields.  Returns <code>true</code>
 * if this <code>URL</code> and the <code>other</code> argument both refer
 * to the same resource.  The two <code>URLs</code> might not both contain
 * the same anchor.
 */
public boolean sameFile(URL other) {
  if (!compare(protocol, other.getProtocol()))
    return (false);
  if (!compare(host, other.getHost()))
    return (false);
  if (port != other.getPort())
    return (false);
  if (!compare(file, other.getFile()))
    return (false);
  return (true);
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * Compare two URLs, excluding the "ref" fields.  Returns <code>true</code>
 * if this <code>URL</code> and the <code>other</code> argument both refer
 * to the same resource.  The two <code>URLs</code> might not both contain
 * the same anchor.
 */
public boolean sameFile(URL other) {
  if (!compare(protocol, other.getProtocol()))
    return (false);
  if (!compare(host, other.getHost()))
    return (false);
  if (port != other.getPort())
    return (false);
  if (!compare(file, other.getFile()))
    return (false);
  return (true);
}

代码示例来源:origin: codefollower/Tomcat-Research

/**
 * Compare two URLs, excluding the "ref" fields.  Returns <code>true</code>
 * if this <code>URL</code> and the <code>other</code> argument both refer
 * to the same resource.  The two <code>URLs</code> might not both contain
 * the same anchor.
 */
public boolean sameFile(URL other) {
  if (!compare(protocol, other.getProtocol()))
    return (false);
  if (!compare(host, other.getHost()))
    return (false);
  if (port != other.getPort())
    return (false);
  if (!compare(file, other.getFile()))
    return (false);
  return (true);
}

代码示例来源:origin: codefollower/Tomcat-Research

/**
 * Compare two URLs for equality.  The result is <code>true</code> if and
 * only if the argument is not null, and is a <code>URL</code> object
 * that represents the same <code>URL</code> as this object.  Two
 * <code>URLs</code> are equal if they have the same protocol and
 * reference the same host, the same port number on the host,
 * and the same file and anchor on the host.
 *
 * @param obj The URL to compare against
 */
@Override
public boolean equals(Object obj) {
  if (!(obj instanceof URL))
    return (false);
  URL other = (URL) obj;
  if (!sameFile(other))
    return (false);
  return (compare(ref, other.getRef()));
}

代码示例来源:origin: org.apache.coyote/com.springsource.org.apache.coyote

/**
 * Compare two URLs for equality.  The result is <code>true</code> if and
 * only if the argument is not null, and is a <code>URL</code> object
 * that represents the same <code>URL</code> as this object.  Two
 * <code>URLs</code> are equal if they have the same protocol and
 * reference the same host, the same port number on the host,
 * and the same file and anchor on the host.
 *
 * @param obj The URL to compare against
 */
@Override
public boolean equals(Object obj) {
  if (!(obj instanceof URL))
    return (false);
  URL other = (URL) obj;
  if (!sameFile(other))
    return (false);
  return (compare(ref, other.getRef()));
}

代码示例来源:origin: org.apache.coyote.springsource/com.springsource.org.apache.coyote.springsource

/**
 * Compare two URLs for equality.  The result is <code>true</code> if and
 * only if the argument is not null, and is a <code>URL</code> object
 * that represents the same <code>URL</code> as this object.  Two
 * <code>URLs</code> are equal if they have the same protocol and
 * reference the same host, the same port number on the host,
 * and the same file and anchor on the host.
 *
 * @param obj The URL to compare against
 */
public boolean equals(Object obj) {
  if (obj == null)
    return (false);
  if (!(obj instanceof URL))
    return (false);
  URL other = (URL) obj;
  if (!sameFile(other))
    return (false);
  return (compare(ref, other.getRef()));
}

代码示例来源:origin: org.apache.geronimo.ext.tomcat/catalina

/**
 * Compare two URLs for equality.  The result is <code>true</code> if and
 * only if the argument is not null, and is a <code>URL</code> object
 * that represents the same <code>URL</code> as this object.  Two
 * <code>URLs</code> are equal if they have the same protocol and
 * reference the same host, the same port number on the host,
 * and the same file and anchor on the host.
 *
 * @param obj The URL to compare against
 */
@Override
public boolean equals(Object obj) {
  if (!(obj instanceof URL))
    return (false);
  URL other = (URL) obj;
  if (!sameFile(other))
    return (false);
  return (compare(ref, other.getRef()));
}

代码示例来源:origin: com.ovea.tajin.server/tajin-server-tomcat7

/**
 * Compare two URLs for equality.  The result is <code>true</code> if and
 * only if the argument is not null, and is a <code>URL</code> object
 * that represents the same <code>URL</code> as this object.  Two
 * <code>URLs</code> are equal if they have the same protocol and
 * reference the same host, the same port number on the host,
 * and the same file and anchor on the host.
 *
 * @param obj The URL to compare against
 */
@Override
public boolean equals(Object obj) {
  if (!(obj instanceof URL))
    return (false);
  URL other = (URL) obj;
  if (!sameFile(other))
    return (false);
  return (compare(ref, other.getRef()));
}

代码示例来源:origin: org.jboss.web/jbossweb

/**
 * Compare two URLs for equality.  The result is <code>true</code> if and
 * only if the argument is not null, and is a <code>URL</code> object
 * that represents the same <code>URL</code> as this object.  Two
 * <code>URLs</code> are equal if they have the same protocol and
 * reference the same host, the same port number on the host,
 * and the same file and anchor on the host.
 *
 * @param obj The URL to compare against
 */
public boolean equals(Object obj) {
  if (obj == null)
    return (false);
  if (!(obj instanceof URL))
    return (false);
  URL other = (URL) obj;
  if (!sameFile(other))
    return (false);
  return (compare(ref, other.getRef()));
}

代码示例来源:origin: jboss.web/jbossweb

/**
 * Compare two URLs for equality.  The result is <code>true</code> if and
 * only if the argument is not null, and is a <code>URL</code> object
 * that represents the same <code>URL</code> as this object.  Two
 * <code>URLs</code> are equal if they have the same protocol and
 * reference the same host, the same port number on the host,
 * and the same file and anchor on the host.
 *
 * @param obj The URL to compare against
 */
public boolean equals(Object obj) {
  if (obj == null)
    return (false);
  if (!(obj instanceof URL))
    return (false);
  URL other = (URL) obj;
  if (!sameFile(other))
    return (false);
  return (compare(ref, other.getRef()));
}

相关文章