package com.foreverwin.mesnac.dataimport.reader;

import java.text.MessageFormat;

public class FileReaderBuilder {

    public FileReader build(String fileType) throws Exception {

        if ("csv".equalsIgnoreCase(fileType)) {
            return new CsvFileReader();
        }

        if ("xls".equalsIgnoreCase(fileType)) {
            //return new XlsFileReader();
            return new XlsxFileReader(fileType);
        }

        if ("xlsx".equalsIgnoreCase(fileType)) {
            return new XlsxFileReader(fileType);
        }
        throw new Exception(MessageFormat.format("File type {0}  not support ", fileType));
    }


}
