use of org.wildfly.swarm.undertow.internal.FaviconServletExtension in project wildfly-swarm by wildfly-swarm.
the class WebXmlContainer method addFaviconExceptionHandler.
/**
* Add the default Thorntail {@code favicon.ico} handler.
*
* @return This archive.
*/
@SuppressWarnings("unchecked")
default T addFaviconExceptionHandler() throws IOException {
// Add FaviconServletExtension
String path = "WEB-INF/classes/" + FaviconServletExtension.EXTENSION_NAME.replace('.', '/') + ".class";
byte[] generatedExtension;
generatedExtension = FaviconFactory.createFaviconServletExtension(FaviconServletExtension.EXTENSION_NAME);
add(new ByteArrayAsset(generatedExtension), path);
// Add FaviconErrorHandler
path = "WEB-INF/classes/" + FaviconServletExtension.HANDLER_NAME.replace('.', '/') + ".class";
byte[] generatedHandler;
generatedHandler = FaviconFactory.createFaviconErrorHandler(FaviconServletExtension.HANDLER_NAME);
add(new ByteArrayAsset(generatedHandler), path);
// Add services entry for FaviconServletExtension
this.addAsServiceProvider(ServletExtension.class.getName(), FaviconServletExtension.EXTENSION_NAME);
return (T) this;
}
Aggregations