- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 32 of file FileBean.java.
◆ FileBean()
org.turro.elephant.impl.util.FileBean.FileBean |
( |
| ) |
|
◆ getAction()
String org.turro.elephant.impl.util.FileBean.getAction |
( |
| ) |
|
◆ getAllowedLocales()
String [] org.turro.elephant.impl.util.FileBean.getAllowedLocales |
( |
| ) |
|
Definition at line 54 of file FileBean.java.
55 if(defaultLocales ==
null) {
56 ElContext currContext = ElContextMap.getContext(context);
57 defaultLocales = currContext.getDefaultLocales().toArray(
new String[0]);
59 return defaultLocales;
◆ getConstructor()
IConstructor org.turro.elephant.impl.util.FileBean.getConstructor |
( |
| ) |
|
◆ getContext()
String org.turro.elephant.impl.util.FileBean.getContext |
( |
| ) |
|
◆ getFile()
String org.turro.elephant.impl.util.FileBean.getFile |
( |
| ) |
|
◆ getLastWikiString()
String org.turro.elephant.impl.util.FileBean.getLastWikiString |
( |
| ) |
|
Definition at line 68 of file FileBean.java.
69 if(file ==
null || file.length() == 0)
return null;
70 if(lastWiki ==
null) {
71 File folder =
new File(ElephantContext.getRealPath(context));
72 File files[] = folder.listFiles();
73 String filePrefix = FileUtil.crudeName(file),
74 fileName, lang = FileUtil.getLang(file);
75 for(
int i = 0; i < files.length; i++) {
76 fileName = files[i].getName();
77 if(fileName.endsWith(lang +
".wiki") && fileName.startsWith(filePrefix)) {
78 lastWiki = (lastWiki ==
null || fileName.compareTo(lastWiki) > 0) ? fileName : lastWiki;
◆ getRealContext()
String org.turro.elephant.impl.util.FileBean.getRealContext |
( |
| ) |
|
Definition at line 46 of file FileBean.java.
47 return FileUtil.getRealContext(context);
◆ getRepositoryPath()
String org.turro.elephant.impl.util.FileBean.getRepositoryPath |
( |
| ) |
|
Definition at line 50 of file FileBean.java.
51 return context +
"/_internal/repository";
◆ getSelectedLocale()
String org.turro.elephant.impl.util.FileBean.getSelectedLocale |
( |
| ) |
|
Definition at line 62 of file FileBean.java.
63 if(localeCount > defaultLocales.length) localeCount = 0;
64 return file.startsWith(FileUtil.crudeName(file) + defaultLocales[localeCount++] +
".")
◆ getWiki()
String org.turro.elephant.impl.util.FileBean.getWiki |
( |
| ) |
throws IOException |
Definition at line 85 of file FileBean.java.
86 File folder =
new File(ElephantContext.getRealPath(context));
87 if(!folder.exists()) folder.mkdirs();
88 if(
"new".equals(action))
return "";
89 File edit =
new File(ElephantContext.getRealPath(context +
"/" + file));
93 if(lastWiki !=
null) {
94 content =
new File(ElephantContext.getRealPath(context +
"/" + lastWiki));
99 StringBuilder sb =
new StringBuilder();
100 try (BufferedReader br = FileUtil.getBufferedFile(content)) {
102 while((s = br.readLine()) !=
null) {
106 return sb.toString();
String getLastWikiString()
◆ setAction()
void org.turro.elephant.impl.util.FileBean.setAction |
( |
String |
action | ) |
|
◆ setConstructor()
void org.turro.elephant.impl.util.FileBean.setConstructor |
( |
IConstructor |
constructor | ) |
|
Definition at line 111 of file FileBean.java.
112 this.constructor = constructor;
◆ setContext()
void org.turro.elephant.impl.util.FileBean.setContext |
( |
String |
context | ) |
|
◆ setFile()
void org.turro.elephant.impl.util.FileBean.setFile |
( |
String |
file | ) |
|
The documentation for this class was generated from the following file: