Package com.hsbc.cranker.mucranker
Class FavIconHandler
- java.lang.Object
-
- com.hsbc.cranker.mucranker.FavIconHandler
-
- All Implemented Interfaces:
io.muserver.MuHandler
public class FavIconHandler extends Object implements io.muserver.MuHandler
This is a convenience class to make it easy to serve a favicon.ico file for your router. Place an.icofile on your classpath, then create a FavIconHandler withfromClassPath(String)and add it to your mu-server.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FavIconHandlerfromClassPath(String iconPath)Creates a Mu Handler that serves a favicon file.booleanhandle(io.muserver.MuRequest req, io.muserver.MuResponse resp)
-
-
-
Method Detail
-
fromClassPath
public static FavIconHandler fromClassPath(String iconPath) throws IOException
Creates a Mu Handler that serves a favicon file.- Parameters:
iconPath- The classpath path to yourfavicon.icofile, for example/web/favicon.ico- Returns:
- A handler that you can add to
MuServerBuilder.addHandler(MuHandler) - Throws:
IOException- Thrown if the icon doesn't exist or cannot be read
-
-