<commit_before>package de.ronnyfriedland.knowledgebase.repository.fs;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.BasicFileAttributes;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import de.ronnyfriedland.knowledgebase.cache.RepositoryCache;
import de.ronnyfriedland.knowledgebase.configuration.Configuration;
import de.ronnyfriedland.knowledgebase.entity.FileDocument;
import de.ronnyfriedland.knowledgebase.exception.DataException;
import de.ronnyfriedland.knowledgebase.repository.IRepository;
import de.ronnyfriedland.knowledgebase.resource.RepositoryMetadata;
import de.ronnyfriedland.knowledgebase.resource.RepositoryMetadata.MetadataKeyValue;

/**
 * @author ronnyfriedland
 *
 */
@org.springframework.stereotype.Repository
@org.springframework.beans.factory.annotation.Qualifier("fs")
public class FileSystemRepository implements IRepository<FileDocument<byte[]>> {

    private static final Logger LOG = LoggerFactory.getLogger(FileSystemRepository.class);

    private SimpleDateFormat df = new SimpleDateFormat("MM.dd.yyyy HH:mm:ss");

    @Autowired
    private Configuration configuration;

    @Autowired
    private RepositoryCache<FileDocument<byte[]>> fileCache;

    /**
     * {@inheritDoc}
     *
     * @see de.ronnyfriedland.knowledgebase.repository.IRepository#getDocument(java.lang.String)
     */
    @Override
    public FileDocument<byte[]> getDocument(String key) throws DataException {
        FileDocument<byte[]> cachedDocument = fileCache.get(key);<commit_msg>fix dateformat<commit_after>package de.ronnyfriedland.knowledgebase.repository.fs;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.BasicFileAttributes;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;

import org.apache.commons.io.IOUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import de.ronnyfriedland.knowledgebase.cache.RepositoryCache;
import de.ronnyfriedland.knowledgebase.configuration.Configuration;
import de.ronnyfriedland.knowledgebase.entity.FileDocument;
import de.ronnyfriedland.knowledgebase.exception.DataException;
import de.ronnyfriedland.knowledgebase.repository.IRepository;
import de.ronnyfriedland.knowledgebase.resource.RepositoryMetadata;
import de.ronnyfriedland.knowledgebase.resource.RepositoryMetadata.MetadataKeyValue;

/**
 * @author ronnyfriedland
 *
 */
@org.springframework.stereotype.Repository
@org.springframework.beans.factory.annotation.Qualifier("fs")
public class FileSystemRepository implements IRepository<FileDocument<byte[]>> {

    private static final Logger LOG = LoggerFactory.getLogger(FileSystemRepository.class);

    private SimpleDateFormat df = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");

    @Autowired
    private Configuration configuration;

    @Autowired
    private RepositoryCache<FileDocument<byte[]>> fileCache;

    /**
     * {@inheritDoc}
     *
     * @see de.ronnyfriedland.knowledgebase.repository.IRepository#getDocument(java.lang.String)
     */
    @Override
    public FileDocument<byte[]> getDocument(String key) throws DataException {
        FileDocument<byte[]> cachedDocument = fileCache.get(key);
{'fraction_non_alphanumeric': 0.10185427004439801, 'fraction_numerical': 0.0010446591799425438, 'mean_word_length': 5.888489208633094, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '7491666', 'n_tokens_mistral': 1101, 'n_tokens_neox': 1084, 'n_words': 180}