<commit_before>package org.docserv;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.NotFoundException;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.EntityTag;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Request;
import javax.ws.rs.core.Response;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Path("/document")
@Produces(MediaType.APPLICATION_JSON)
public class DocumentResource {
	
	@Autowired
	private DocumentFactory documentFactory;

	@GET
	public List<String> documentList() {
    	return Arrays.asList(
			Application.DOCUMENT_FOLDER.list( 
				(File dir, String name) -> {
					File file = new File(dir, name);
					return file.isFile() && documentFactory.isSupported(file); 
				}
			)
		);
    }

	private File openDocumentFile(String documentName) {
		File documentFile = new File(Application.DOCUMENT_FOLDER, documentName);
		if (!documentFile.exists()) {
			throw new NotFoundException();
		}
		return documentFile;
	}
	
	private EntityTag createETag(File documentFile) {
		return new EntityTag(documentFile.lastModified() + "");
	}
	<commit_msg>removed old folder list from document resource<commit_after>package org.docserv;

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.NotFoundException;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.EntityTag;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Request;
import javax.ws.rs.core.Response;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
@Path("/document")
@Produces(MediaType.APPLICATION_JSON)
public class DocumentResource {
	
	@Autowired
	private DocumentFactory documentFactory;

	private File openDocumentFile(String documentName) {
		File documentFile = new File(Application.DOCUMENT_FOLDER, documentName);
		if (!documentFile.exists()) {
			throw new NotFoundException();
		}
		return documentFile;
	}
	
	private EntityTag createETag(File documentFile) {
		return new EntityTag(documentFile.lastModified() + "");
	}
	
{'fraction_non_alphanumeric': 0.11389884508164078, 'fraction_numerical': 0.0, 'mean_word_length': 5.023980815347722, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, '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': '5209429', 'n_tokens_mistral': 828, 'n_tokens_neox': 794, 'n_words': 163}