package com.gci.boot.enums;

import com.gci.boot.constant.FileConstant;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;


/**
 * @author 24642
 */

public enum FileExtension {
    /**
     * 图片
     */
    PIC(Arrays.asList(FileConstant.JPG, FileConstant.PNG, FileConstant.GIF, FileConstant.TIF, FileConstant.BMP, FileConstant.PSD)),

    /**
     * 文档
     */
    DOC(Arrays.asList(FileConstant.DOC,FileConstant.DOCX,FileConstant.XLSX,FileConstant.PPTX,FileConstant.XLS,FileConstant.RTF, FileConstant.EML, FileConstant.MDB, FileConstant.PS, FileConstant.PDF, FileConstant.WPD, FileConstant.DBX, FileConstant.PST, FileConstant.QDF)),

    /**
     * 视频
     */
    VID(Arrays.asList(FileConstant.RMVB,FileConstant.FLV,FileConstant.MP4,FileConstant.M4V,FileConstant.MPG,FileConstant.WMV,FileConstant.AVI,FileConstant.MOV)),

    /**
     * 音频
     */
    AUD(Arrays.asList(FileConstant.MP3,FileConstant.WAV,FileConstant.MID)),

    /**
     * 压缩文件后缀
     */
    COM(Arrays.asList(FileConstant.RAR,FileConstant.ZIP,FileConstant.GZ)),

    /**
     * 可执行文件后缀
     */
    EXE(Arrays.asList(FileConstant.EXE,FileConstant.JSP,FileConstant.MF,FileConstant.JAVA,FileConstant.BAT)),

    /**
     * 其他文件后缀
     */
    OTH(Arrays.asList(FileConstant.APK,FileConstant.DWG,FileConstant.JAR,FileConstant.CLASS,FileConstant.CHM,FileConstant.MXP,FileConstant.TORRENT,FileConstant.PWL,FileConstant.RAM));
    private List<String> nameList;

    FileExtension(List<String> nameList) {
        this.nameList = nameList;
    }

    public List<String> getNameList() {
        return nameList;
    }

    public void setNameList(List<String> nameList) {
        this.nameList = nameList;
    }
    
    public static List<String> getCommonFileTypes() {
    	List<String> fileTypes = new ArrayList<>();
		fileTypes.addAll(FileExtension.PIC.getNameList());
		fileTypes.addAll(FileExtension.DOC.getNameList());
		fileTypes.addAll(FileExtension.COM.getNameList());
		fileTypes.addAll(FileExtension.VID.getNameList());
		return fileTypes;
    }
}