FR [ 2406123 ] Ini.saveProperties fails if target directory does not exist

This commit is contained in:
teo_sarca 2008-12-08 10:46:25 +00:00
parent 533d0763b9
commit f009cb66cb
1 changed files with 7 additions and 5 deletions

View File

@ -52,17 +52,18 @@ import org.compiere.model.ModelValidationEngine;
* Load & Save INI Settings fopm property file * Load & Save INI Settings fopm property file
* Initiated in Adempiere.startup * Initiated in Adempiere.startup
* Settings activated in ALogin.getIni * Settings activated in ALogin.getIni
* <p>
* Change log:
* <ul>
* <li>2007-02-12 - teo_sarca - [ 1658127 ] Select charset encoding on import
* </ul>
* *
* @author Jorg Janke * @author Jorg Janke
* @version $Id$ * @version $Id$
*
* @author Teo Sarca, www.arhipac.ro
* <li>FR [ 1658127 ] Select charset encoding on import
* <li>FR [ 2406123 ] Ini.saveProperties fails if target directory does not exist
*/ */
public final class Ini implements Serializable public final class Ini implements Serializable
{ {
private static final long serialVersionUID = 1L;
/** Property file name */ /** Property file name */
public static final String ADEMPIERE_PROPERTY_FILE = "Adempiere.properties"; public static final String ADEMPIERE_PROPERTY_FILE = "Adempiere.properties";
@ -256,6 +257,7 @@ public final class Ini implements Serializable
try try
{ {
File f = new File(fileName); File f = new File(fileName);
f.getParentFile().mkdirs(); // Create all dirs if not exist - teo_sarca FR [ 2406123 ]
fos = new FileOutputStream(f); fos = new FileOutputStream(f);
s_prop.store(fos, "Adempiere"); s_prop.store(fos, "Adempiere");
fos.flush(); fos.flush();