package com.workfusion.odf.impl.processor.extractor;

import java.util.function.Predicate;

import javax.inject.Inject;

import org.slf4j.Logger;

import com.workfusion.odf.api.domain.Document;
import com.workfusion.odf.impl.converter.extractor.AbstractRecursiveExtractor;
import com.workfusion.odf.impl.converter.extractor.zip.RecursiveZipExtractor;
import com.workfusion.rpa.core.storage.S3Manager;

public class ZipFlatMapProcessor extends AbstractFlatMapper {
    private final static String S3_FOLDER = "zip_flatMap";

    @Inject
    public ZipFlatMapProcessor(S3Manager s3Manager, Logger logger) {
        super(s3Manager, logger);
    }

    @Override
    protected Predicate<Document> getDocumentFilter() {
        return Document::isZipDocument;
    }

    @Override
    protected AbstractRecursiveExtractor getRecursiveExtractor() {
        return new RecursiveZipExtractor(logger);
    }

    @Override
    protected String getS3Folder() {
        return S3_FOLDER;
    }
}
