All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fastchar.extjs.accepter.FastExtAppJsAccepter Maven / Gradle / Ivy

Go to download

FastChar-ExtJs is a Java Web framework that uses extjs libraries.Quickly build a background management system

There is a newer version: 2.2.2
Show newest version
package com.fastchar.extjs.accepter;

import com.fastchar.core.FastEngine;
import com.fastchar.extjs.FastExtConfig;
import com.fastchar.extjs.compress.GoogleCompress;
import com.fastchar.interfaces.IFastScannerAccepter;
import com.fastchar.utils.FastStringUtils;

import java.io.File;

public class FastExtAppJsAccepter implements IFastScannerAccepter {

    @Override
    public void onScannerClass(FastEngine engine, Class scannedClass) throws Exception {
    }

    @Override
    public void onScannerFile(FastEngine engine, File file) throws Exception {
        FastExtConfig extConfig = engine.getConfig(FastExtConfig.class);
        if (extConfig.isCompressAppJs()) {
            if (file.getName().endsWith(".js")) {
                String filePath = file.getPath();
                filePath = FastStringUtils.strip(filePath.replace(engine.getPath().getWebRootPath(), ""), "/");
                if (filePath.endsWith(".min.js")) {
                    return;
                }
                if ((filePath.startsWith("app/"))) {
                    GoogleCompress.compress(file.getPath());
                }
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy