package com.xiaoniu.subsystem.strategy.factory;


import com.xiaoniu.subsystem.strategy.*;

public class UnZipStrategyFactory {

    public static UnZipStrategy generate(String suffix) {
        UnZipStrategy strategy;
        switch (suffix) {
            case "zip":
                strategy = new ZipAnalysisStrategy();
                break;
            case "tar":
                strategy = new TarAnalysisStrategy();
                break;
            case "rar":
                strategy = new RarAnalysisStrategy();
                break;
            case "7z":
                strategy = new SevenZAnalysisStrategy();
                break;
            default:
                strategy = null;
                break;
        }
        return strategy;
    }
}
