Package com.google.common.jimfs
Class Handler
- java.lang.Object
-
- java.net.URLStreamHandler
-
- com.google.common.jimfs.Handler
-
public final class Handler extends java.net.URLStreamHandler
URLStreamHandler
implementation for jimfs. NamedHandler
so that the class can be found by Java as described in the documentation forURL
.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 Summary
Fields Modifier and Type Field Description private static java.lang.String
JAVA_PROTOCOL_HANDLER_PACKAGES
-
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 packagecom.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 placedHandler
class.
-
-
-
Field Detail
-
JAVA_PROTOCOL_HANDLER_PACKAGES
private static final java.lang.String JAVA_PROTOCOL_HANDLER_PACKAGES
- See Also:
- Constant Field Values
-
-
Method Detail
-
register
static void register()
Registers this handler by adding the packagecom.google.common
to the system property"java.protocol.handler.pkgs"
. Java will then look for this class in thejimfs
(the name of the protocol) package ofcom.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 placedHandler
class.
-
openConnection
protected java.net.URLConnection openConnection(java.net.URL url) throws java.io.IOException
- Specified by:
openConnection
in classjava.net.URLStreamHandler
- Throws:
java.io.IOException
-
getHostAddress
protected @Nullable java.net.InetAddress getHostAddress(java.net.URL url)
- Overrides:
getHostAddress
in classjava.net.URLStreamHandler
-
-