package com.avg.zaap.crashlibrary.publish.packer;

import com.avg.zaap.crashlibrary.core.logger.ILogger;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.RandomAccessFile;

/**
 * Interface for factory that will gives new instances for better testing.
 * Created by marek.osvald on 19.4.2016.
 */
public interface IBinUnPackerFactory {

    /**
     * Gives new RandomAccessFile for read.
     *
     * @param path to read from.
     * @return new RandomAccessFile.
     * @throws FileNotFoundException when the path is incorrect.
     */
    RandomAccessFile getReadRandomAccessFile(String path) throws FileNotFoundException;

    /**
     * Gives new File from given path.
     *
     * @param path to new File.
     * @return new File.
     */
    File getFile(String path);

    /**
     * Gives new FileOutputStream from given file.
     *
     * @param output file to store data to.
     * @return wanted stream.
     * @throws FileNotFoundException when the path is incorrect.
     */
    FileOutputStream getFileOutputStream(File output) throws FileNotFoundException;

    /**
     * Gives desired logger.
     *
     * @return {@link com.avg.zaap.crashlibrary.core.logger.JavaSystemLogger}.
     */
    ILogger getLogger();

}
