made XmlDatabase use the app's charset

(app.properties/charset=ISO...)
new method: Application.getCharset()
This commit is contained in:
stefanp 2002-08-16 18:22:47 +00:00
parent eb397b6def
commit e4979a7175
2 changed files with 6 additions and 0 deletions

View file

@ -1319,6 +1319,10 @@ public final class Application
return starttime;
}
public String getCharset () {
return props.getProperty ("charset", "ISO-8859-1");
}
/**
* Periodically called to log thread stats for this application
*/

View file

@ -22,12 +22,14 @@ public class XmlDatabase implements IDatabase {
// use standard encoding by default.
private String encoding = null;
public XmlDatabase (String dbHome, String dbFilename, NodeManager nmgr) throws DatabaseException {
this.dbHome = dbHome;
this.nmgr = nmgr;
dbBaseDir = new File (dbHome);
if (!dbBaseDir.exists() && !dbBaseDir.mkdirs() )
throw new RuntimeException("Couldn't create DB-directory");
this.encoding = nmgr.app.getCharset ();
}
public void shutdown () { }