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

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;

/**
 * This class serves as the default dependency factory for {@link ExternalStorageCrashPublisher}
 * <p/>
 * Created by marek.osvald on 29.4.2016.
 */
public class ExternalStorageCrashPublisherFactory implements IExternalStorageCrashPublisherFactory {

    @Override
    public File openFile(String filePath) {
        return new File(filePath);
    }

    @Override
    public File openFile(File directory, String fileName) {
        return new File(directory, fileName);
    }

    @Override
    public InputStream openFileInputStream(File file) throws FileNotFoundException {
        return new FileInputStream(file);
    }

    @Override
    public OutputStream openFileOutputStream(File file) throws FileNotFoundException {
        return new FileOutputStream(file);
    }

    @Override
    public byte[] getBuffer(int size) {
        return new byte[size];
    }

}
