Reading from & Writing to Property.lax File
Hi Everyone
I have a small application that uses a Property File that was created by InstallAnywhere Free Now, Version 4. I interrogate this file to see if it contains all the necessary information I need to run my application. If it does not contain the information, I then add on to this Property.lax file. But it then overrides all the comments that was made by InstallAnywhere. Could somebody please explain to me how I can overcome this problem. Below is an example of how I read and write to & from the Property.lax file.
java.util.Properties prop =new java.util.Properties();
File f =new File(sPropertyLax,"PropertyLax.lax");
if (f.exists())
{
FileInputStream fi =new FileInputStream(f);
prop.load(fi);
String sVm =null;
String sClass =null;
sVm = prop.getProperty("lax.nl.current.vm","" + sVm);
sClass = prop.getProperty("lax.class.path","" + sClassPath);
sVm = sVm.substring(0, sVm.indexOf("bin\\jre.exe"));
if ((!sClass.endsWith(sVm)) && (!sClass.startsWith(sVm)))
{
FileOutputStream fo =new FileOutputStream(f);
sClass +=";" + sVm;
prop.put("lax.class.path=",sClassPath);
prop.save(fo,"");
}
fi.close();
}
I'd appresiate it if somebode could please help me with this propblem. Thanx
Ciao

