Class JarHandler

java.lang.Object
java.net.URLStreamHandler
libcore.net.url.JarHandler

public class JarHandler
extends URLStreamHandler
  • Constructor Details

    • JarHandler

      public JarHandler()
  • Method Details

    • openConnection

      protected URLConnection openConnection​(URL u) throws IOException
      Returns a connection to the jar file pointed by this URL in the file system
      Specified by:
      openConnection in class URLStreamHandler
      Parameters:
      u - java.net.URL The URL to which the connection is pointing to
      Returns:
      java.net.URLConnection A connection to the resource pointed by this url.
      Throws:
      IOException - thrown if an IO error occurs when this method tries to establish connection.
    • parseURL

      protected void parseURL​(URL url, String spec, int start, int limit)
      Description copied from class: URLStreamHandler
      Parses the clear text URL in str into a URL object. URL strings generally have the following format:

      http://www.company.com/java/file1.java#reference

      The string is parsed in HTTP format. If the protocol has a different URL format this method must be overridden.

      Overrides:
      parseURL in class URLStreamHandler
      Parameters:
      url - URL the context URL
      spec - java.lang.String the spec string
      start - int the location to start parsing from
      limit - int the location where parsing ends
      See Also:
      URLStreamHandler.toExternalForm(java.net.URL), URL
    • toExternalForm

      protected String toExternalForm​(URL url)
      Build and return the externalized string representation of url.
      Overrides:
      toExternalForm in class URLStreamHandler
      Parameters:
      url - a URL
      Returns:
      String the externalized string representation of url
      See Also:
      URLStreamHandler.parseURL(java.net.URL, java.lang.String, int, int), URL.toExternalForm()