Class Handler


  • public final class Handler
    extends java.net.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
    • Constructor Summary

      Constructors 
      Constructor Description
      Handler()
      Deprecated.
      Not intended to be called directly; this class is only for use by Java itself.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected @Nullable java.net.InetAddress getHostAddress​(java.net.URL url)  
      protected java.net.URLConnection openConnection​(java.net.URL url)  
      (package private) static void register()
      Registers this handler by adding the package com.google.common to the system property "java.protocol.handler.pkgs".
      (package private) static void register​(java.lang.Class<? extends java.net.URLStreamHandler> handlerClass)
      Generic method that would allow registration of any properly placed Handler class.
      • Methods inherited from class java.net.URLStreamHandler

        equals, getDefaultPort, hashCode, hostsEqual, openConnection, parseURL, sameFile, setURL, setURL, toExternalForm
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • JAVA_PROTOCOL_HANDLER_PACKAGES

        private static final java.lang.String JAVA_PROTOCOL_HANDLER_PACKAGES
        See Also:
        Constant Field Values
    • Constructor Detail

      • Handler

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

      • 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:
        java.lang.SecurityException - if the system property that needs to be set to register this handler can't be read or written.
      • register

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

        protected java.net.URLConnection openConnection​(java.net.URL url)
                                                 throws java.io.IOException
        Specified by:
        openConnection in class java.net.URLStreamHandler
        Throws:
        java.io.IOException
      • getHostAddress

        protected @Nullable java.net.InetAddress getHostAddress​(java.net.URL url)
        Overrides:
        getHostAddress in class java.net.URLStreamHandler