Module cloud.piranha.resource
Package cloud.piranha.resource
Class ByteArrayResourceStreamHandlerProvider
java.lang.Object
java.net.spi.URLStreamHandlerProvider
cloud.piranha.resource.ByteArrayResourceStreamHandlerProvider
- All Implemented Interfaces:
java.net.URLStreamHandlerFactory
public class ByteArrayResourceStreamHandlerProvider
extends java.net.spi.URLStreamHandlerProvider
Handler for the
bytes://
protocol.- Author:
- Arjan Tijms
-
Constructor Summary
Constructors Constructor Description ByteArrayResourceStreamHandlerProvider()
-
Method Summary
Modifier and Type Method Description java.net.URLStreamHandler
createURLStreamHandler(java.lang.String protocol)
static void
setGetResourceAsStreamFunction(java.util.function.Function<java.lang.String,java.io.InputStream> getResourceAsStreamFunction)
Sets a Function that provides the input stream based on the string form of abytes://
URL.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
ByteArrayResourceStreamHandlerProvider
public ByteArrayResourceStreamHandlerProvider()
-
-
Method Details
-
createURLStreamHandler
public java.net.URLStreamHandler createURLStreamHandler(java.lang.String protocol) -
setGetResourceAsStreamFunction
public static void setGetResourceAsStreamFunction(java.util.function.Function<java.lang.String,java.io.InputStream> getResourceAsStreamFunction)Sets a Function that provides the input stream based on the string form of abytes://
URL.- Parameters:
getResourceAsStreamFunction
- the function to transform a string URL to an input stream
-