Class Handler

java.lang.Object
java.net.URLStreamHandler
com.google.common.jimfs.Handler

public final class Handler extends URLStreamHandler
URLStreamHandler implementation for jimfs. Named Handler so that the class can be found by Java as described in the documentation for URL.

This class is only public because it is necessary for Java to find it. It is not intended to be used directly.

Since:
1.1
  • Field Details

  • Constructor Details

    • Handler

      @Deprecated public Handler()
      Deprecated.
      Not intended to be called directly; this class is only for use by Java itself.
  • Method Details

    • register

      static void register()
      Registers this handler by adding the package com.google.common to the system property "java.protocol.handler.pkgs". Java will then look for this class in the jimfs (the name of the protocol) package of com.google.common.
      Throws:
      SecurityException - if the system property that needs to be set to register this handler can't be read or written.
    • register

      static void register(Class<? extends URLStreamHandler> handlerClass)
      Generic method that would allow registration of any properly placed Handler class.
    • openConnection

      protected URLConnection openConnection(URL url) throws IOException
      Specified by:
      openConnection in class URLStreamHandler
      Throws:
      IOException
    • getHostAddress

      protected @Nullable InetAddress getHostAddress(URL url)
      Overrides:
      getHostAddress in class URLStreamHandler