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

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

/**
 * This interface denotes the common behavior
 * <p>
 * Created by marek.osvald on 25. 4. 2016.
 */
public interface IDataWriterFactory {

    /**
     * Returns a file instance for the given file path.
     *
     * @param path file path to retrieve the file for
     * @return an instance of file for the given file path
     */
    File getFile(String path);

    /**
     * Returns a writer instance for the given output stream.
     *
     * @param file file instance to get the file writer for
     * @return a writer instance for the given output stream
     * @throws IOException if file cannot be opened for writing
     */
    Writer getFileWriter(File file) throws IOException;

    /**
     * Returns an instance of buffered writer.
     *
     * @param writer writer to decorate the buffered writer with
     * @return an instance of buffered writer
     */
    Writer getBufferedWriter(Writer writer);

}
