package com.avg.zaap.crashlibrary.offline.publisher.metadata;

import android.support.annotation.NonNull;

import com.avg.zaap.crashlibrary.ReportData;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.Reader;
import java.util.ArrayList;
import java.util.List;

/**
 * This class serves as the default crash metadata reader factory.
 * <p/>
 * Created by marek.osvald on 29.7.2016.
 */
public class CrashMetadataReaderFactory implements ICrashMetadataReaderFactory {

    @Override
    public ICrashMetadataHelper getCrashMetadataHelper() {
        return new CrashMetadataHelper();
    }

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

    @Override
    public ReportData getReportData() {
        return new ReportData();
    }

    @Override
    public Reader getReader(File file) throws FileNotFoundException {
        return new FileReader(file);
    }

    @Override
    public BufferedReader getBufferedReader(@NonNull Reader reader) {
        return new BufferedReader(reader);
    }

    @Override
    public List<String> getList(int capacity) {
        return new ArrayList<>(capacity);
    }

}
