Package org.infinispan.commons.util
Class ClasspathURLStreamHandler
- java.lang.Object
-
- org.infinispan.commons.util.ClasspathURLStreamHandler
-
- All Implemented Interfaces:
URLStreamHandlerFactory
public class ClasspathURLStreamHandler extends Object implements URLStreamHandlerFactory
AURLStreamHandlerFactorywhich can handle classpath: URI schemes. It will attempt to load resources from the thread's context classloader (if it exists) and then fallback to the system classloader. The factory must be registered as the URL stream handler factory using theregister()method. On Java 9+, this class is available as a URLStreamHandlerProvider service loader implementation which, if present in the boot classpath, will be automatically registered and used by theURLclass.- Since:
- 12.1
- Author:
- Tristan Tarrant <tristan@infinispan.org>
-
-
Constructor Summary
Constructors Constructor Description ClasspathURLStreamHandler()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description URLStreamHandlercreateURLStreamHandler(String protocol)static voidregister()Registers this URL handler as the JVM-wide URL stream handler.
-
-
-
Method Detail
-
register
public static void register()
Registers this URL handler as the JVM-wide URL stream handler. It can only be invoked once in the lifecycle of an application. Refer to theURLdocumentation for restrictions and alternative methods of registration.
-
createURLStreamHandler
public URLStreamHandler createURLStreamHandler(String protocol)
-
-