Package net.hasor.core

Examples of net.hasor.core.Environment.evalString()


        //JAVA_HOME
        System.out.println(env.getEnvVar("JAVA_HOME"));
        //HASOR_WORK_HOME,该环境变量由 hasor 的配置文件提供,仅在Hasor框架内有效
        System.out.println(env.getEnvVar("HASOR_WORK_HOME"));
        //javac.exe
        System.out.println(env.evalString("%JAVA_HOME%/bin/javac.exe"));
    }
}
View Full Code Here


        //
        //设置属性
        System.setProperty("MyVar", "hello");
        env.refreshVariables();/*刷新变量列表*/
        System.out.println(env.getEnvVar("MyVar"));
        System.out.println(env.evalString("i say %MyVar%."));
    }
}
View Full Code Here

    public void loadModule(WebApiBinder apiBinder) {
        //1.准备参数
        Environment env = apiBinder.getEnvironment();
        //3.缓存路径
        String cacheSubPath = "%HASOR_PLUGIN_PATH%/net.hasor.web.resource/";
        File cacheDir = new File(env.evalString(cacheSubPath));
        if (!chekcCacheDir(cacheDir)) {
            int i = 0;
            while (true) {
                cacheDir = new File(env.evalString(cacheSubPath + "_" + String.valueOf(i)));;
                if (chekcCacheDir(cacheDir))
View Full Code Here

        String cacheSubPath = "%HASOR_PLUGIN_PATH%/net.hasor.web.resource/";
        File cacheDir = new File(env.evalString(cacheSubPath));
        if (!chekcCacheDir(cacheDir)) {
            int i = 0;
            while (true) {
                cacheDir = new File(env.evalString(cacheSubPath + "_" + String.valueOf(i)));;
                if (chekcCacheDir(cacheDir))
                    break;
            }
        }
        ResourceHttpServlet.initCacheDir(cacheDir);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.