package com.avg.zaap.crashlibrary.offline.uploader;

import android.content.Context;

import com.avg.zaap.crashlibrary.CrashPublishingDelegate;
import com.avg.zaap.crashlibrary.ICrashPublishingDelegate;
import com.avg.zaap.crashlibrary.offline.publisher.OfflineReportFilenameFilter;
import com.avg.zaap.crashlibrary.offline.publisher.metadata.CrashMetadataReader;
import com.avg.zaap.crashlibrary.offline.publisher.metadata.ICrashMetadataReader;

import java.io.File;
import java.io.FilenameFilter;

/**
 * This class serves as the default offline uploader dependency factory.
 * <p/>
 * Created by marek.osvald on 27.7.2016.
 */
public class OfflineUploaderFactory implements IOfflineUploaderFactory {

    @Override
    public Thread getThread(Runnable runnable) {
        return new Thread(runnable);
    }

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

    @Override
    public FilenameFilter getCrashReportFilenameFilter() {
        return new OfflineReportFilenameFilter();
    }

    @Override
    public ICrashPublishingDelegate getCrashPublishingDelegate(Context context) {
        return new CrashPublishingDelegate(context);
    }

    @Override
    public ICrashMetadataReader getCrashMetadataReader() {
        return new CrashMetadataReader();
    }

    @Override
    public IDelayHelper getDelayHelper() {
        return new DelayHelper();
    }

}
