<commit_before>/**
 *  Copyright (C) 2008 Progress Software, Inc. All rights reserved.
 *  http://fusesource.com
 *
 *  The software in this package is published under the terms of the AGPL license
 *  a copy of which has been included with this distribution in the license.txt file.
 */
package org.fusesource.cloudmix.controller.resources;

import com.sun.jersey.spi.inject.Inject;
import org.fusesource.cloudmix.common.GridController;
import org.fusesource.cloudmix.common.dto.ProfileDetailsList;
import org.fusesource.cloudmix.common.dto.ProfileDetails;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import java.util.List;

@Path("/profiles")
public class ProfilesResource extends ResourceSupport {
    @Inject
    GridController controller;

    public void setController(GridController c) {
        controller = c;
    }

    public List<ProfileDetails> getProfiles() {
        return getProfileList().getProfiles();
    }
    
    @GET
    @Produces("application/xml")
    public ProfileDetailsList getProfileList() {
        return new ProfileDetailsList(controller.getProfileDetails());
    }
    
    @Path("{id:.*}")
    public ProfileResource getProfile(@PathParam("id") String id) {
        return new ProfileResource(controller, id);
    }    
}<commit_msg>removed unnecessary attempt at a fix for CLOUDMIX-14 to use simpler expression again<commit_after>/**
 *  Copyright (C) 2008 Progress Software, Inc. All rights reserved.
 *  http://fusesource.com
 *
 *  The software in this package is published under the terms of the AGPL license
 *  a copy of which has been included with this distribution in the license.txt file.
 */
package org.fusesource.cloudmix.controller.resources;

import com.sun.jersey.spi.inject.Inject;
import org.fusesource.cloudmix.common.GridController;
import org.fusesource.cloudmix.common.dto.ProfileDetailsList;
import org.fusesource.cloudmix.common.dto.ProfileDetails;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import java.util.List;

@Path("/profiles")
public class ProfilesResource extends ResourceSupport {
    @Inject
    GridController controller;

    public void setController(GridController c) {
        controller = c;
    }

    public List<ProfileDetails> getProfiles() {
        return getProfileList().getProfiles();
    }
    
    @GET
    @Produces("application/xml")
    public ProfileDetailsList getProfileList() {
        return new ProfileDetailsList(controller.getProfileDetails());
    }
    
    @Path("{id}")
    public ProfileResource getProfile(@PathParam("id") String id) {
        return new ProfileResource(controller, id);
    }    
}
{'fraction_non_alphanumeric': 0.10087719298245613, 'fraction_numerical': 0.003654970760233918, 'mean_word_length': 3.8271604938271606, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '4050794', 'n_tokens_mistral': 792, 'n_tokens_neox': 787, 'n_words': 206}