package com.avg.zaap.crashlibrary.core.writer;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.Writer;

/**
 * This class serves as the default dependency factory for {@link DataWriter}.
 * <p>
 * Created by marek.osvald on 25. 4. 2016.
 */
public class DataWriterFactory implements IDataWriterFactory {

    @Override
    public File getFile(String path) {
        return new File(path);
    }

    @Override
    public Writer getFileWriter(File file) throws IOException {
        return new FileWriter(file);
    }

    @Override
    public Writer getBufferedWriter(Writer writer) {
        return new BufferedWriter(writer);
    }

}
