All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.femo.http.drivers.server.HttpRouterHandle Maven / Gradle / Ivy

Go to download

An easy to use HTTP API, that supports synchronous and asynchronous execution of HTTP request. On android only asynchronous driver is supported. This library has been backported to jdk 7 to retain compatibility with android!

The newest version!
package io.femo.http.drivers.server;

import io.femo.http.HttpHandleException;
import io.femo.http.HttpRequest;
import io.femo.http.HttpResponse;
import io.femo.http.HttpRouter;

/**
 * Created by Felix Resch on 29-Apr-16.
 */
public class HttpRouterHandle implements HttpHandle {

    private HttpRouter httpRouter;

    @Override
    public boolean matches(HttpRequest request) {
        return httpRouter.matches(request);
    }

    @Override
    public boolean handle(HttpRequest request, HttpResponse response) throws HttpHandleException {
        return httpRouter.handle(request, response);
    }

    @Override
    public void parentPath(String path) {
        httpRouter.parentPath(path);
    }

    @Override
    public void prependPath(String path) {
        this.httpRouter.prependPath(path);
    }

    public void setRouter(HttpRouter httpRouter) {
        this.httpRouter = httpRouter;
    }

    public HttpRouter router() {
        return this.httpRouter;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy