File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77import act .plugin .AppServicePlugin ;
88import act .plugin .Plugin ;
99import act .util .ActContext ;
10+ import org .osgl .util .C ;
11+ import org .osgl .util .IO ;
1012import org .osgl .util .S ;
1113
1214import java .io .File ;
15+ import java .util .List ;
1316
1417/**
1518 * The base class that different View solution should extends
@@ -61,6 +64,22 @@ protected final String templateHome() {
6164 return templateHome ;
6265 }
6366
67+ /**
68+ * Load template content.
69+ *
70+ * This method is used by error reporting feature when app running in dev mode
71+ * @param template the template path
72+ * @return the template content in lines
73+ */
74+ protected List <String > loadContent (String template ) {
75+ File file = new File (templateRootDir (), template );
76+ if (file .exists () && file .canRead ()) {
77+ return IO .readLines (file );
78+ }
79+ return C .list ();
80+ }
81+
82+
6483 protected final File templateRootDir () {
6584 App app = Act .app ();
6685 return new File (app .layout ().resource (app .base ()), templateHome ());
You can’t perform that action at this time.
0 commit comments