Tabnine Logo
URL.equals
Code IndexAdd Tabnine to your IDE (free)

How to use
equals
method
in
java.net.URL

Best Java code snippets using java.net.URL.equals (Showing top 20 results out of 3,141)

origin: spring-projects/spring-framework

/**
 * This implementation compares the underlying URL references.
 */
@Override
public boolean equals(Object other) {
  return (this == other || (other instanceof UrlResource &&
      this.cleanedUrl.equals(((UrlResource) other).cleanedUrl)));
}
origin: org.springframework/spring-core

/**
 * This implementation compares the underlying URL references.
 */
@Override
public boolean equals(Object other) {
  return (this == other || (other instanceof UrlResource &&
      this.cleanedUrl.equals(((UrlResource) other).cleanedUrl)));
}
origin: micronaut-projects/micronaut-core

/**
 * This implementation compares the underlying URL references.
 */
@Override
public boolean equals(Object obj) {
  return (obj == this ||
    (obj instanceof UrlResource && cleanedUrl.equals(((UrlResource) obj).cleanedUrl)));
}
origin: org.freemarker/freemarker

@Override
public boolean equals(Object o) {
  if (o instanceof URLTemplateSource) {
    return url.equals(((URLTemplateSource) o).url);
  } else {
    return false;
  }
}
origin: spotbugs/spotbugs

static boolean g(URL u1, URL u2) {
  return u1.equals(u2);
}
origin: redisson/redisson

  @Override
  @SuppressFBWarnings(value = "DMI_BLOCKING_METHODS_ON_URL", justification = "Package sealing relies on URL equality")
  public boolean equals(Object other) {
    if (this == other) {
      return true;
    } else if (other == null || getClass() != other.getClass()) {
      return false;
    }
    ForFixedValue forFixedValue = (ForFixedValue) other;
    return sealBase.equals(forFixedValue.sealBase);
  }
}
origin: gocd/gocd

@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;
  AgentBootstrapperArgs that = (AgentBootstrapperArgs) o;
  if (serverUrl != null ? !serverUrl.equals(that.serverUrl) : that.serverUrl != null) return false;
  if (rootCertFile != null ? !rootCertFile.getAbsoluteFile().equals(that.rootCertFile.getAbsoluteFile()) : that.rootCertFile != null) return false;
  return sslVerificationMode == that.sslVerificationMode;
}
origin: HotswapProjects/HotswapAgent

@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;
  XmlBeanRefreshCommand that = (XmlBeanRefreshCommand) o;
  return this.url.equals(that.url);
}
origin: redisson/redisson

  @Override
  @SuppressFBWarnings(value = "DMI_BLOCKING_METHODS_ON_URL", justification = "Package sealing relies on URL equality")
  public boolean equals(Object other) {
    if (this == other) {
      return true;
    } else if (other == null || getClass() != other.getClass()) {
      return false;
    }
    Simple simple = (Simple) other;
    return !(specificationTitle != null ? !specificationTitle.equals(simple.specificationTitle) : simple.specificationTitle != null)
        && !(specificationVersion != null ? !specificationVersion.equals(simple.specificationVersion) : simple.specificationVersion != null)
        && !(specificationVendor != null ? !specificationVendor.equals(simple.specificationVendor) : simple.specificationVendor != null)
        && !(implementationTitle != null ? !implementationTitle.equals(simple.implementationTitle) : simple.implementationTitle != null)
        && !(implementationVersion != null ? !implementationVersion.equals(simple.implementationVersion) : simple.implementationVersion != null)
        && !(implementationVendor != null ? !implementationVendor.equals(simple.implementationVendor) : simple.implementationVendor != null)
        && !(sealBase != null ? !sealBase.equals(simple.sealBase) : simple.sealBase != null);
  }
}
origin: HotswapProjects/HotswapAgent

@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;
  BeanClassRefreshCommand that = (BeanClassRefreshCommand) o;
  if (!appClassLoader.equals(that.appClassLoader)) return false;
  if (beanArchiveUrl != null && !beanArchiveUrl.equals(that.beanArchiveUrl)) return false;
  return true;
}
origin: org.apache.logging.log4j/log4j-api

@Override
public boolean equals(final Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  final UrlResource that = (UrlResource) o;
  if (classLoader != null ? !classLoader.equals(that.classLoader) : that.classLoader != null) {
    return false;
  }
  if (url != null ? !url.equals(that.url) : that.url != null) {
    return false;
  }
  return true;
}
origin: gocd/gocd

@Override
public boolean equals(Object o) {
  if (this == o) {
    return true;
  }
  if (o == null || getClass() != o.getClass()) {
    return false;
  }
  PluginNamespace that = (PluginNamespace) o;
  if (prefix != null ? !prefix.equals(that.prefix) : that.prefix != null) {
    return false;
  }
  if (uri != null ? !uri.equals(that.uri) : that.uri != null) {
    return false;
  }
  if (xsdResource != null ? !xsdResource.equals(that.xsdResource) : that.xsdResource != null) {
    return false;
  }
  return true;
}
origin: cloudfoundry/uaa

@Override
public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;
  if (!super.equals(o)) return false;
  OIDCIdentityProviderDefinition that = (OIDCIdentityProviderDefinition) o;
  if (userInfoUrl != null ? !userInfoUrl.equals(that.userInfoUrl) : that.userInfoUrl != null) return false;
  if (this.passwordGrantEnabled != that.passwordGrantEnabled) return false;
  return discoveryUrl != null ? discoveryUrl.equals(that.discoveryUrl) : that.discoveryUrl == null;
}
origin: stackoverflow.com

new URL("http://www.yahoo.com").equals(new URL("http://209.191.93.52"))
origin: org.netbeans.api/org-openide-util

@Override
public boolean equals(Object obj) {
  if (obj == null) {
    return false;
  }
  if (getClass() != obj.getClass()) {
    return false;
  }
  final HelpCtx other = (HelpCtx) obj;
  if (this.helpCtx != other.helpCtx && (this.helpCtx == null || !this.helpCtx.equals(other.helpCtx))) {
    return false;
  }
  if ((this.helpID == null) ? (other.helpID != null) : !this.helpID.equals(other.helpID)) {
    return false;
  }
  return true;
}
origin: apache/geode

/**
 * Returns true if the specified location is in the JVM classpath. This may ignore additions to
 * the classpath that are not reflected by the value in
 * {@code System.getProperty("java.class.path")}.
 *
 * @param location the directory or jar URL to test for
 * @return true if location is in the JVM classpath
 */
public static boolean isInClassPath(URL location) throws MalformedURLException {
 String classPath = getClassPath();
 StringTokenizer st = new StringTokenizer(classPath, File.pathSeparator);
 while (st.hasMoreTokens()) {
  String path = st.nextToken();
  if (location.equals(new File(path).toURI().toURL())) {
   return true;
  }
 }
 return false;
}
origin: org.apache.ant/ant

private boolean isOneOf(Object o, Resource importedResource,
            File importedFile, URL importedURL) {
  if (o.equals(importedResource) || o.equals(importedFile)
    || o.equals(importedURL)) {
    return true;
  }
  if (o instanceof Resource) {
    if (importedFile != null) {
      FileProvider fp = ((Resource) o).as(FileProvider.class);
      if (fp != null && fp.getFile().equals(importedFile)) {
        return true;
      }
    }
    if (importedURL != null) {
      URLProvider up = ((Resource) o).as(URLProvider.class);
      return up != null && up.getURL().equals(importedURL);
    }
  }
  return false;
}
origin: spotbugs/spotbugs

  @ExpectWarning("Dm")
  public BadApplet() {
    URL u1 = getDocumentBase();
    URL u2 = getCodeBase();

    if (u1.equals(u2))
      return;

    if (getParameter("bad") != null)
      return;

    if (getAppletContext() != null)
      return;
  }
}
origin: org.apache.ant/ant

/**
 * Test whether an Object equals this URLResource.
 * @param another the other Object to compare.
 * @return true if the specified Object is equal to this Resource.
 */
public synchronized boolean equals(Object another) {
  if (this == another) {
    return true;
  }
  if (isReference()) {
    return getCheckedRef().equals(another);
  }
  if (another == null || another.getClass() != getClass()) {
    return false;
  }
  URLResource other = (URLResource) another;
  return getURL() == null
    ? other.getURL() == null
    : getURL().equals(other.getURL());
}
origin: apache/ignite

/** {@inheritDoc} */
@SuppressWarnings({"BigDecimalEquals", "EqualsHashCodeCalledOnUrl", "RedundantIfStatement"})
@Override public boolean equals(Object o) {
  if (this == o) return true;
  if (o == null || getClass() != o.getClass()) return false;
  TestObject that = (TestObject)o;
  if (id != that.id) return false;
  if (!Arrays.equals(arrVal, that.arrVal)) return false;
  if (bigVal != null ? !bigVal.equals(that.bigVal) : that.bigVal != null) return false;
  if (boolVal != null ? !boolVal.equals(that.boolVal) : that.boolVal != null) return false;
  if (byteVal != null ? !byteVal.equals(that.byteVal) : that.byteVal != null) return false;
  if (dateVal != null ? !dateVal.equals(that.dateVal) : that.dateVal != null) return false;
  if (doubleVal != null ? !doubleVal.equals(that.doubleVal) : that.doubleVal != null) return false;
  if (f1 != null ? !f1.equals(that.f1) : that.f1 != null) return false;
  if (f2 != null ? !f2.equals(that.f2) : that.f2 != null) return false;
  if (f3 != null ? !f3.equals(that.f3) : that.f3 != null) return false;
  if (floatVal != null ? !floatVal.equals(that.floatVal) : that.floatVal != null) return false;
  if (intVal != null ? !intVal.equals(that.intVal) : that.intVal != null) return false;
  if (longVal != null ? !longVal.equals(that.longVal) : that.longVal != null) return false;
  if (shortVal != null ? !shortVal.equals(that.shortVal) : that.shortVal != null) return false;
  if (strVal != null ? !strVal.equals(that.strVal) : that.strVal != null) return false;
  if (timeVal != null ? !timeVal.equals(that.timeVal) : that.timeVal != null) return false;
  if (tsVal != null ? !tsVal.equals(that.tsVal) : that.tsVal != null) return false;
  if (urlVal != null ? !urlVal.equals(that.urlVal) : that.urlVal != null) return false;
  return true;
}
java.netURLequals

Javadoc

Returns true if this URL equals o. URLs are equal if they have the same protocol, host, port, file, and reference.

Network I/O Warning

Some implementations of URL.equals() resolve host names over the network. This is problematic:

  • The network may be slow. Many classes, including core collections like java.util.Map and java.util.Set expect that equals and hashCode will return quickly. By violating this assumption, this method posed potential performance problems.
  • Equal IP addresses do not imply equal content. Virtual hosting permits unrelated sites to share an IP address. This method could report two otherwise unrelated URLs to be equal because they're hosted on the same server.
  • The network many not be available. Two URLs could be equal when a network is available and unequal otherwise.
  • The network may change. The IP address for a given host name varies by network and over time. This is problematic for mobile devices. Two URLs could be equal on some networks and unequal on others.

This problem is fixed in Android 4.0 (Ice Cream Sandwich). In that release, URLs are only equal if their host names are equal (ignoring case).

Popular methods of URL

  • <init>
  • openStream
    Opens a connection to this URL and returns anInputStream for reading from that connection. This meth
  • openConnection
    Returns a new connection to the resource referred to by this URL.
  • toString
    Constructs a string representation of this URL. The string is created by calling the toExternalForm
  • getPath
    Gets the path part of this URL.
  • toURI
    Returns a java.net.URI equivalent to this URL. This method functions in the same way as new URI (thi
  • getProtocol
    Gets the protocol name of this URL.
  • getFile
    Gets the file name of this URL. The returned file portion will be the same as getPath(), plus the c
  • toExternalForm
    Constructs a string representation of this URL. The string is created by calling the toExternalForm
  • getHost
    Gets the host name of this URL, if applicable. The format of the host conforms to RFC 2732, i.e. for
  • getPort
    Gets the port number of this URL.
  • getQuery
    Gets the query part of this URL.
  • getPort,
  • getQuery,
  • getRef,
  • getUserInfo,
  • getAuthority,
  • hashCode,
  • getDefaultPort,
  • getContent,
  • setURLStreamHandlerFactory

Popular in Java

  • Finding current android device location
  • getSharedPreferences (Context)
  • getResourceAsStream (ClassLoader)
  • setRequestProperty (URLConnection)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • ImageIO (javax.imageio)
  • JTextField (javax.swing)
  • Runner (org.openjdk.jmh.runner)
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now