★ wanayoo — archive 1999 http://www.webtechniques.com/sourcecode/1997/09/darby/6.lstNouvelle recherche | Portail wanayoo

 
| home | current issue | archives | source code | events | demo express | search | editorial calendar | advertising | customer service | author guidelines | jobs | about

S O U R C E   C O D E / 1997 / 09 / darby / 6.lst

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);
          }          
  }


| home | current issue | archives | source code | demo express | events | search | editorial calendar | advertising | customer service | author guidelines | jobs | about




Entire contents copyright 1996-2000 CMP Media Inc.
Read our privacy policy.