![JAR search and dependency download from the Maven repository](/logo.png)
org.bitbucket.gkutiel.in.my.mind.dispatcher.Dispatcher Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of in-my-mind Show documentation
Show all versions of in-my-mind Show documentation
An opinionated web framework on top of in-core
The newest version!
package org.bitbucket.gkutiel.in.my.mind.dispatcher;
import static java.lang.Class.forName;
import org.bitbucket.gkutiel.in.Handler;
import io.reactivex.netty.protocol.http.server.HttpServerRequest;
public class Dispatcher implements org.bitbucket.gkutiel.in.Dispatcher {
static String className(final String path) {
return "www" + ("/" + path + "/").replaceAll("/+", ".") + "Index";
}
@Override public Handler handler(final HttpServerRequest> req) {
try {
return (Handler) forName(className(req.getPath())).newInstance();
} catch (final Exception e) {
throw new RuntimeException(e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy