<commit_before>package de.hsmainz.pubApp.geocoder.resource;


import com.google.gson.Gson;
import de.hsmainz.pubApp.geocoder.httpApiRequest.HttpAPIRequest;
import de.hsmainz.pubApp.geocoder.httpApiRequest.HttpGraphhopperRequest;
import de.hsmainz.pubApp.geocoder.jsonparser.geoJson.GeoJsonColection;


import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;


/**
 * Created by Arno on 03.12.2016.
 */
@Path("geocoder")
public class Resource {

    /**
     * Method handling HTTP GET requests. The returned object will be sent
     * to the client as "text/plain" media type.
     *
     * @return String that will be returned as a text/plain response.
     */
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String geoCoder(@QueryParam("queryString") String queryString, @QueryParam("locale") String locale){
        Gson gson = new Gson();

        HttpAPIRequest httpAPIRequest = new HttpGraphhopperRequest();

        GeoJsonColection geoJsonColection = httpAPIRequest.requestGeocoder(queryString,locale);

        return gson.toJson(geoJsonColection);
    }


}<commit_msg>First Version of Callback wrap<commit_after>package de.hsmainz.pubApp.geocoder.resource;


import com.google.gson.Gson;
import de.hsmainz.pubApp.geocoder.httpApiRequest.HttpAPIRequest;
import de.hsmainz.pubApp.geocoder.httpApiRequest.HttpGraphhopperRequest;
import de.hsmainz.pubApp.geocoder.jsonparser.geoJson.GeoJsonColection;


import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;


/**
 * Created by Arno on 03.12.2016.
 */
@Path("geocoder")
public class Resource {

    /**
     * Method handling HTTP GET requests. The returned object will be sent
     * to the client as "text/plain" media type.
     *
     * @return String that will be returned as a text/plain response.
     */
    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String geoCoder(@QueryParam("callback") String callback,@QueryParam("queryString") String queryString, @QueryParam("locale") String locale){
        Gson gson = new Gson();

        HttpAPIRequest httpAPIRequest = new HttpGraphhopperRequest();

        GeoJsonColection geoJsonColection = httpAPIRequest.requestGeocoder(queryString,locale);

        return callback + '(' + gson.toJson(geoJsonColection) + ')';
    }


}
{'fraction_non_alphanumeric': 0.10740740740740741, 'fraction_numerical': 0.006584362139917695, 'mean_word_length': 3.9511201629327903, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6722137', 'n_tokens_mistral': 817, 'n_tokens_neox': 779, 'n_words': 167}