| ★ wanayoo — archive 1999 http://www.webtechniques.com/sourcecode/1997/09/darby/6.lst | Nouvelle recherche | Portail wanayoo |
|
|
|||
| | home | current issue | archives | source code | events | demo express | search | editorial calendar | advertising | customer service | author guidelines | jobs | about | |||
|
|
|||
public void save() throws IOException
{
ObjectOutput divisionOutputStream = null;
String fileName = divisionDataPath + name + ".division";
String lockFileName = this.name + ".lock";
DataOutputStream lockos;
File lockFile;
try
{
lockFile = new File(divisionDataPath + lockFileName);
while (lockFile.exists())
{
Thread.sleep(200);
}
lockos = new DataOutputStream(new FileOutputStream
(divisionDataPath + lockFileName));
divisionOutputStream = new ObjectOutputStream
(new FileOutputStream(fileName));
divisionOutputStream.writeObject(this);
divisionOutputStream.flush();
divisionOutputStream.close();
lockos.close();
lockFile.delete();
}
catch (InterruptedException exc)
{
System.out.println(exc);
}
}