public Http4K publishFileSystem( String hostName, String urlPath, int port, File root ) {
        if ( ! root.exists() )
            root.mkdirs();
        if ( ! root.isDirectory() ) {
            throw new RuntimeException("root must be an existing direcory:"+root.getAbsolutePath());
        }
        Pair<PathHandler, Undertow> server = getServer(port, hostName);
        server.car().addPrefixPath(urlPath, new ResourceHandler(new FileResourceManager(root,100)));
        return this;
    }
public Http4K publishFileSystem ( String hostName , String urlPath , int port , File root ) { if ( ! root . exists ( ) ) root . mkdirs ( ) ; if ( ! root . isDirectory ( ) ) { throw new RuntimeException ( "root must be an existing direcory:" + root . getAbsolutePath ( ) ) ; } Pair < PathHandler , Undertow > server = getServer ( port , hostName ) ; server . car ( ) . addPrefixPath ( urlPath , new ResourceHandler ( new FileResourceManager ( root , 100 ) ) ) ; return this ; }
publishes given file root
@param hostName
@param urlPath - prefixPath (e.g. /myapp/resource)
@param port
@param root - directory to be published