File installPropFile = new File(configDir,"install.properties");
FileOutputStream fos = null;
try {
fos = new FileOutputStream(installPropFile);
OutputStreamWriter osw = new OutputStreamWriter(fos,"UTF-8");
PropertiesWriter propWriter = new PropertiesWriter(osw);
propWriter.write(publicProps);
osw.flush();
} catch(Exception e) {
throw new Exception("Unable to write config properties to: "+installPropFile.getAbsolutePath(), e);
} finally {
if( null != fos ){
try{
fos.close();
} catch(Exception e) {
// Ignore
}
}
}
}
// Write sensitive file
{
File sensitivePropFile = new File(configDir,"sensitive.properties");
FileOutputStream fos = null;
try {
fos = new FileOutputStream(sensitivePropFile);
OutputStreamWriter osw = new OutputStreamWriter(fos,"UTF-8");
PropertiesWriter propWriter = new PropertiesWriter(osw);
propWriter.write(sensitiveProps);
osw.flush();
} catch(Exception e) {
throw new Exception("Unable to write config properties to: "+sensitivePropFile.getAbsolutePath(), e);