<commit_before>package de.jeha.s3srv.operations.buckets;

import com.codahale.metrics.annotation.Timed;
import de.jeha.s3srv.api.ListBucketResult;
import de.jeha.s3srv.jaxb.JaxbMarshaller;
import de.jeha.s3srv.operations.AbstractOperation;
import de.jeha.s3srv.storage.StorageBackend;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author <EMAIL>
 */
@Path("/")
public class ListObjects extends AbstractOperation {
    private static final Logger LOG = LoggerFactory.getLogger(ListObjects.class);

    public ListObjects(StorageBackend storageBackend) {
        super(storageBackend);
    }

    @GET
    @Path("/{bucket}/")
    @Timed
    public Response listBuckets(@PathParam("bucket") String bucket) {
        LOG.info("listObjects {}", bucket);

        List<ListBucketResult.ContentsEntry> objects = getStorageBackend()
                .listObjects(bucket)
                .stream()
                .map(object -> new ListBucketResult.ContentsEntry(
                        object.getKey(),
                        object.getLastModified(),
                        object.getETag(),
                        object.getSize()))
                .collect(Collectors.toList());

        ListBucketResult response = new ListBucketResult(bucket, 0, 1000, objects);

        try {
            return Response.ok(JaxbMarshaller.marshall(response), MediaType.APPLICATION_XML_TYPE).build();
        } catch (Exception e) {
            LOG.error("Unable to create xml response body", e);
            return Response.serverError().build();
        }
    }
}
<commit_msg>fix keyCount<commit_after>package de.jeha.s3srv.operations.buckets;

import com.codahale.metrics.annotation.Timed;
import de.jeha.s3srv.api.ListBucketResult;
import de.jeha.s3srv.jaxb.JaxbMarshaller;
import de.jeha.s3srv.operations.AbstractOperation;
import de.jeha.s3srv.storage.StorageBackend;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
import java.util.List;
import java.util.stream.Collectors;

/**
 * @author <EMAIL>
 */
@Path("/")
public class ListObjects extends AbstractOperation {
    private static final Logger LOG = LoggerFactory.getLogger(ListObjects.class);

    public ListObjects(StorageBackend storageBackend) {
        super(storageBackend);
    }

    @GET
    @Path("/{bucket}/")
    @Timed
    public Response listBuckets(@PathParam("bucket") String bucket) {
        LOG.info("listObjects {}", bucket);

        List<ListBucketResult.ContentsEntry> objects = getStorageBackend()
                .listObjects(bucket)
                .stream()
                .map(object -> new ListBucketResult.ContentsEntry(
                        object.getKey(),
                        object.getLastModified(),
                        object.getETag(),
                        object.getSize()))
                .collect(Collectors.toList());

        ListBucketResult response = new ListBucketResult(bucket, objects.size(), 1000, objects);

        try {
            return Response.ok(JaxbMarshaller.marshall(response), MediaType.APPLICATION_XML_TYPE).build();
        } catch (Exception e) {
            LOG.error("Unable to create xml response body", e);
            return Response.serverError().build();
        }
    }
}

{'fraction_non_alphanumeric': 0.11664810690423162, 'fraction_numerical': 0.006403118040089087, 'mean_word_length': 2.7079463364293086, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '1087424', 'n_tokens_mistral': 1062, 'n_tokens_neox': 1038, 'n_words': 189}