<commit_before>package com.github.davinkevin.podcastserver.service

import com.github.davinkevin.podcastserver.item.ItemService
import com.github.davinkevin.podcastserver.service.properties.PodcastServerParameters
import org.slf4j.LoggerFactory
import org.springframework.stereotype.Service
import reactor.core.publisher.Mono
import reactor.core.publisher.toMono
import java.nio.file.Files
import java.nio.file.Path

/**
 * Created by kevin on 2019-02-09
 */
@Service
class FileService(val p: PodcastServerParameters) {

    private val log = LoggerFactory.getLogger(ItemService::class.java)

    fun deleteItem(path: Path) = Mono.defer {
        val file = p.rootfolder.resolve(path)
        log.info("Deletion of file {}", file)
        Files
                .deleteIfExists(file)
                .toMono()
    }

    fun exists(path: Path) = Mono.defer {
        val file = p.rootfolder.resolve(path)
        val exists = Files.exists(file)
        log.info("the file $file exists: $exists")
        exists
                .toMono()
                .filter { it }
                .map { path }
    }
}<commit_msg>chore(log): change log level of FileService<commit_after>package com.github.davinkevin.podcastserver.service

import com.github.davinkevin.podcastserver.item.ItemService
import com.github.davinkevin.podcastserver.service.properties.PodcastServerParameters
import org.slf4j.LoggerFactory
import org.springframework.stereotype.Service
import reactor.core.publisher.Mono
import reactor.core.publisher.toMono
import java.nio.file.Files
import java.nio.file.Path

/**
 * Created by kevin on 2019-02-09
 */
@Service
class FileService(val p: PodcastServerParameters) {

    private val log = LoggerFactory.getLogger(FileService::class.java)

    fun deleteItem(path: Path) = Mono.defer {
        val file = p.rootfolder.resolve(path)
        log.info("Deletion of file {}", file)
        Files
                .deleteIfExists(file)
                .toMono()
    }

    fun exists(path: Path) = Mono.defer {
        val file = p.rootfolder.resolve(path)
        val exists = Files.exists(file)
        log.debug("the file $file exists: $exists")
        exists
                .toMono()
                .filter { it }
                .map { path }
    }
}
{'fraction_non_alphanumeric': 0.10296067167476801, 'fraction_numerical': 0.007954043305346884, 'mean_word_length': 2.723684210526316, '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': '5329001', 'n_tokens_mistral': 709, 'n_tokens_neox': 669, 'n_words': 139}