All Downloads are FREE. Search and download functionalities are using the official Maven repository.

kr.jm.metric.input.FileInput Maven / Gradle / Ivy

There is a newer version: 0.2.7.3
Show newest version
package kr.jm.metric.input;

import kr.jm.metric.config.input.FileInputConfig;
import kr.jm.metric.data.Transfer;
import kr.jm.utils.helper.JMFiles;
import lombok.ToString;

import java.util.function.Consumer;

@ToString(callSuper = true)
public class FileInput extends AbstractInput {

    public FileInput(FileInputConfig inputConfig) {
        super(inputConfig);
    }

    @Override
    protected void startImpl(Consumer> inputConsumer) {
        JMFiles.getLineStream(this.inputConfig.getFilePath())
                .map(this::newTransfer).forEach(inputConsumer);
    }

    public FileInput(String filePath) {
        this(new FileInputConfig(filePath));
    }

    @Override
    protected void closeImpl() {

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy