Module cloud.piranha.resource.impl
Package cloud.piranha.resource.impl
Class ByteArrayResourceStreamHandlerProvider
java.lang.Object
java.net.spi.URLStreamHandlerProvider
cloud.piranha.resource.impl.ByteArrayResourceStreamHandlerProvider
- All Implemented Interfaces:
URLStreamHandlerFactory
Handler for the
bytes://
protocol.- Author:
- Arjan Tijms
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateURLStreamHandler
(String protocol) static Function<String,
InputStream> Get the Function set to handlebytes://
protocol handling.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
-
getGetResourceAsStreamFunction
Get the Function set to handlebytes://
protocol handling.- Returns:
- the Function, or null.
-
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
-