Module cloud.piranha.resource
Package cloud.piranha.resource
Class ByteArrayResourceStreamHandlerProvider
java.lang.Object
java.net.spi.URLStreamHandlerProvider
cloud.piranha.resource.ByteArrayResourceStreamHandlerProvider
- All Implemented Interfaces:
URLStreamHandlerFactory
Handler for the
bytes://
protocol.- Author:
- Arjan Tijms
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateURLStreamHandler(String protocol)
static void
setGetResourceAsStreamFunction(Function<String,InputStream> getResourceAsStreamFunction)
Sets a Function that provides the input stream based on the string form of abytes://
URL.
-
Constructor Details
-
ByteArrayResourceStreamHandlerProvider
public ByteArrayResourceStreamHandlerProvider()
-
-
Method Details
-
createURLStreamHandler
-
setGetResourceAsStreamFunction
public static void setGetResourceAsStreamFunction(Function<String,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
-