package org.telegram.telegrambots.updatesreceivers;

import org.telegram.telegrambots.api.objects.Update;
import org.telegram.telegrambots.bots.ITelegramWebhookBot;

import javax.ws.rs.*;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author Ruben Bermudez
 * @version 1.0
 * @brief Rest api to for webhook callback function
 * @date 20 of June of 2015
 */
@Path("callback")
class RestApi {

    private final ConcurrentHashMap<String, ITelegramWebhookBot> callbacks = new ConcurrentHashMap<>();

    public RestApi() {
    }

    public void registerCallback(ITelegramWebhookBot callback) {
        if (!callbacks.containsKey(callback.getBotPath())) {
            callbacks.put(callback.getBotPath(), callback);
        }
    }

    @POST
    @Path("/{botPath}")
    @Consumes(MediaType.APPLICATION_JSON)
    @Produces(MediaType.APPLICATION_JSON)
    public Response updateReceived(@PathParam("botPath") String botPath, Update update) {
        if (callbacks.containsKey(botPath)) {
            return Response.ok(this.callbacks.get(botPath).onWebhookUpdateReceived(update)).build();
        }
        return Response.ok().build();
    }

    @GET
    @Path("/{botPath}")
    @Produces(MediaType.APPLICATION_JSON)
    public String testReceived(@PathParam("botPath") String botPath) {
        if (callbacks.containsKey(botPath)) {
            return "Hi there " + botPath + "!";
        } else {
            return "Callback not found for " + botPath;
        }
    }
}

@@ -174,17 +174,205 @@
 java
-x.ws.rs.*
+.util.concurrent.ConcurrentHashMap;%0A%0Aimport javax.ws.rs.Consumes;%0Aimport javax.ws.rs.GET;%0Aimport javax.ws.rs.POST;%0Aimport javax.ws.rs.Path;%0Aimport javax.ws.rs.PathParam;%0Aimport javax.ws.rs.Produces
 ;%0Aim
@@ -441,55 +441,8 @@
 nse;
-%0Aimport java.util.concurrent.ConcurrentHashMap;
 %0A%0A/*
@@ -587,16 +587,23 @@
 lback%22)%0A
+public 
 class Re

Fix RestApi