package epson.print;

import java.io.File;

import epson.common.Utils;

public class GdataConvert {
    private static final int BASE = 100;
    public static final int CONVERT_CANCEL = 103;
    public static final int CONVERT_FAIL = 101;
    public static final int CONVERT_OK = 100;
    public static final int FAIL_SIZEOVER_DOC = 104;
    public static final int FAIL_SIZEOVER_PPT = 106;
    public static final int FAIL_SIZEOVER_SPR = 105;
    public static final int GD_MAXSIZE_DOCUMENT = 2;
    public static final int GD_MAXSIZE_PRESENTATION = 10;
    public static final int GD_MAXSIZE_SPREDSHEET = 20;
    public static final int INTERNET_PROBLEM = 102;

    public static int checkFileSize(String str) {
        float length = (float) ((new File(str).length()) / 1048576.0d);
        String extention = Utils.getExtention(str);
        if (extention == null || extention.length() == 0) {
            return 101;
        }
        return (extention.equalsIgnoreCase(CommonDefine.FileType_WORD_1) || extention.equalsIgnoreCase(CommonDefine.FileType_WORD_2) || extention.equalsIgnoreCase(CommonDefine.FileType_RTF)) ? length > 2.0f ? 104 : 100 : (extention.equalsIgnoreCase(CommonDefine.FileType_EXCEL_1) || extention.equalsIgnoreCase(CommonDefine.FileType_EXCEL_2) || extention.equalsIgnoreCase(CommonDefine.FileType_CSV)) ? length > 20.0f ? 105 : 100 : ((extention.equalsIgnoreCase(CommonDefine.FileType_POWERPOINT_1) || extention.equalsIgnoreCase(CommonDefine.FileType_POWERPOINT_2)) && length > 10.0f) ? 106 : 100;
    }
}
