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

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

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

/**
 * Factory for {@link BinUnPacker} class.
 * Created by marek.osvald on 19.4.2016.
 */
public class BinUnPackerFactory implements IBinUnPackerFactory {
    private static final String READ_ONLY = "r";

    @Override
    public RandomAccessFile getReadRandomAccessFile(String path) throws FileNotFoundException {
        return new RandomAccessFile(path, READ_ONLY);
    }

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

    @Override
    public FileOutputStream getFileOutputStream(File output) throws FileNotFoundException {
        return new FileOutputStream(output);
    }

    @Override
    public ILogger getLogger() {
        return new JavaSystemLogger();
    }
}
