Skip to content

Commit

Permalink
fix file url
Browse files Browse the repository at this point in the history
  • Loading branch information
trytrytryiii committed Mar 2, 2017
1 parent c1d4fb7 commit 9a00840
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/com/tale/init/TaleLoader.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import java.io.File;
import java.lang.reflect.Method;
import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.net.URLClassLoader;

Expand All @@ -29,6 +31,11 @@ public static void init(){
public static void loadThemes(){
BConfig bConfig = $().bConfig();
String themeDir = AttachController.CLASSPATH + "templates/themes";
try {
themeDir = new URI(themeDir).getPath();
} catch (URISyntaxException e) {
e.printStackTrace();
}
File[] dir = new File(themeDir).listFiles();
for(File f : dir){
if(f.isDirectory() && FileKit.isDirectory(f.getPath() + "/static")){
Expand Down
7 changes: 7 additions & 0 deletions src/main/java/com/tale/init/WebContext.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@

import javax.servlet.ServletContext;
import java.io.File;
import java.net.URI;
import java.net.URISyntaxException;

/**
* Tale初始化进程
Expand All @@ -41,6 +43,11 @@ public void init(BConfig bConfig, ServletContext sec) {
templateEngine.addConfig("jetx.import.macros", "/comm/macros.html");
// 扫描主题下面的所有自定义宏
String themeDir = AttachController.CLASSPATH + "templates/themes";
try {
themeDir = new URI(themeDir).getPath();
} catch (URISyntaxException e) {
e.printStackTrace();
}
File[] dir = new File(themeDir).listFiles();
for(File f : dir){
if(f.isDirectory() && FileKit.exist(f.getPath() + "/macros.html")){
Expand Down

0 comments on commit 9a00840

Please sign in to comment.