## Uses of Class
java.net.URL

- Packages that use URL
  Package | Description
  --- | ---
  java.io |
  java.lang |
  java.net |

- - ### Uses of URL in java.io

    Methods in java.io that return URL
    Modifier and Type | Method and Description
    --- | ---
    `URL` | File.`toURL()` Deprecated. This method does not automatically escape characters that are illegal in URLs. It is recommended that new code convert an abstract pathname into a URL by first converting it into a URI, via the `toURI` method, and then converting the URI into a URL via the `URI.toURL` method.

  - ### Uses of URL in java.lang

    Methods in java.lang that return URL
    Modifier and Type | Method and Description
    --- | ---
    `protected URL` | ClassLoader.`findResource(String name)` Finds the resource with the given name.
    `URL` | ClassLoader.`getResource(String name)` Finds the resource with the given name.
    `URL` | Class.`getResource(String name)` Finds a resource with a given name.
    `static URL` | ClassLoader.`getSystemResource(String name)` Find a resource of the specified name from the search path used to load classes.

    Methods in java.lang that return types with arguments of type URL
    Modifier and Type | Method and Description
    --- | ---
    `protected Enumeration<URL>` | ClassLoader.`findResources(String name)` Returns an enumeration of ``URL`` objects representing all the resources with the given name.
    `Enumeration<URL>` | ClassLoader.`getResources(String name)` Finds all the resources with the given name.
    `static Enumeration<URL>` | ClassLoader.`getSystemResources(String name)` Finds all resources of the specified name from the search path used to load classes.

    Methods in java.lang with parameters of type URL
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | Package.`isSealed(URL url)` Returns true if this package is sealed with respect to the specified code source url.

  - ### Uses of URL in java.net

    Fields in java.net declared as URL
    Modifier and Type | Field and Description
    --- | ---
    `protected URL` | URLConnection.`url` The URL represents the remote object on the World Wide Web to which this connection is opened.

    Methods in java.net that return URL
    Modifier and Type | Method and Description
    --- | ---
    `URL` | URLConnection.`getURL()` Returns the value of this `URLConnection`'s `URL` field.
    `URL` | URI.`toURL()` Constructs a URL from this URI.

    Methods in java.net with parameters of type URL
    Modifier and Type | Method and Description
    --- | ---
    `protected boolean` | URLStreamHandler.`equals(URL u1, URL u2)` Provides the default equals calculation.
    `protected int` | URLStreamHandler.`hashCode(URL u)` Provides the default hash calculation.
    `protected boolean` | URLStreamHandler.`hostsEqual(URL u1, URL u2)` Compares the host components of two URLs.
    `protected abstract URLConnection` | URLStreamHandler.`openConnection(URL u)` Opens a connection to the object referenced by the `URL` argument.
    `protected void` | URLStreamHandler.`parseURL(URL u, String spec, int start, int limit)` Parses the string representation of a `URL` into a `URL` object.
    `boolean` | URL.`sameFile(URL other)` Compares two URLs, excluding the fragment component.
    `protected boolean` | URLStreamHandler.`sameFile(URL u1, URL u2)` Compare two urls to see whether they refer to the same file, i.e., having the same protocol, host, port, and path.
    `protected void` | URLStreamHandler.`setURL(URL u, String protocol, String host, int port, String file, String ref)` Deprecated. Use setURL(URL, String, String, int, String, String, String, String);
    `protected void` | URLStreamHandler.`setURL(URL u, String protocol, String host, int port, String authority, String userInfo, String path, String query, String ref)` Sets the fields of the `URL` argument to the indicated values.
    `protected String` | URLStreamHandler.`toExternalForm(URL u)` Converts a `URL` of a specific protocol to a `String`.

    Constructors in java.net with parameters of type URL
    Constructor and Description
    `URL(URL context, String spec)` Creates a URL by parsing the given spec within a specified context.
    `URL(URL context, String spec, URLStreamHandler handler)` Creates a URL by parsing the given spec with the specified handler within a specified context.
    `URLConnection(URL url)` Constructs a URL connection to the specified URL.

Copyright © 2025 API Design. All Rights Reserved.