forked from I2P_Developers/i2p.i2p
* Console: Split initialNews.xml into a file for each language;
don't copy to config dir at install.
This commit is contained in:
@ -6,13 +6,11 @@ import java.util.Locale;
|
||||
import net.i2p.util.FileUtil;
|
||||
|
||||
public class ContentHelper extends HelperBase {
|
||||
private String _page;
|
||||
protected String _page;
|
||||
private int _maxLines;
|
||||
private boolean _startAtBeginning;
|
||||
private String _lang;
|
||||
|
||||
public ContentHelper() {}
|
||||
|
||||
/**
|
||||
* Caution, use absolute paths only, do not assume files are in CWD
|
||||
*/
|
||||
|
@ -0,0 +1,20 @@
|
||||
package net.i2p.router.web;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
* If news file does not exist, use file from the initialNews directory
|
||||
* in $I2P
|
||||
*
|
||||
* @since 0.8.2
|
||||
*/
|
||||
public class NewsHelper extends ContentHelper {
|
||||
|
||||
@Override
|
||||
public String getContent() {
|
||||
File news = new File(_page);
|
||||
if (!news.exists())
|
||||
_page = (new File(_context.getBaseDir(), "docs/initialNews/initialNews.xml")).getAbsolutePath();
|
||||
return super.getContent();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user