com.blade.Blade.addStatics()

Here are the examples of the java api com.blade.Blade.addStatics() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

3 Examples 7

19 Source : TaleLoader.java
with MIT License
from tfssweb

public static void loadThemes() {
    String themeDir = AttachController.CLreplacedPATH + "templates" + File.separatorChar + "themes";
    File[] dir = new File(themeDir).listFiles();
    for (File f : dir) {
        if (f.isDirectory() && Files.isDirectory(Paths.get(f.getPath() + "/static"))) {
            String themePath = "/templates/themes/" + f.getName();
            blade.addStatics(themePath + "/style.css", themePath + "/screenshot.png", themePath + "/static/");
        }
    }
}

19 Source : TaleLoader.java
with MIT License
from tfssweb

public static void loadTheme(String themePath) {
    blade.addStatics(themePath + "/style.css", themePath + "/screenshot.png", themePath + "/static/");
}

15 Source : TaleLoader.java
with MIT License
from tfssweb

/**
 * 加载某个插件jar包
 *
 * @param pluginFile 插件文件
 */
public static void loadPlugin(File pluginFile) {
    try {
        if (pluginFile.isFile() && pluginFile.getName().endsWith(".jar")) {
            URLClreplacedLoader clreplacedLoader = (URLClreplacedLoader) ClreplacedLoader.getSystemClreplacedLoader();
            Method add = URLClreplacedLoader.clreplaced.getDeclaredMethod("addURL", new Clreplaced[] { URL.clreplaced });
            add.setAccessible(true);
            add.invoke(clreplacedLoader, pluginFile.toURI().toURL());
            String pluginName = pluginFile.getName().substring(6);
            blade.addStatics("/templates/plugins/" + pluginName + "/static/");
        }
    } catch (Exception e) {
        throw new RuntimeException("插件 [" + pluginFile.getName() + "] 加载失败");
    }
}