synchronized private void saveState(){
  try {
    File oldFile=new File(m_FileNameWithoutExtention + ".old");
    if (oldFile.exists())     oldFile.delete();
 else     if (m_ContainerFile != null)     m_ContainerFile.renameTo(oldFile);
    if (m_rootContainerElement != null) {
      PrintStream attrStream=new PrintStream(new FileOutputStream(m_FileNameWithoutExtention + ".xml"));
      JSpaceUtilities.domWriter(m_rootContainerElement,attrStream,"");
      attrStream.close();
    }
    if (_logger.isLoggable(Level.FINE)) {
      _logger.fine("The " + m_ContainerFile + " XML file for "+ _containerName+ " container has been updated");
    }
  }
 catch (  FileNotFoundException ex) {
    if (_logger.isLoggable(Level.SEVERE)) {
      _logger.log(Level.SEVERE,"FileNotFoundException: ",ex);
    }
  }
}

synchronized private void saveState ( ) { try { File oldFile = new File ( m_FileNameWithoutExtention + ".old" ) ; if ( oldFile . exists ( ) ) oldFile . delete ( ) ; else if ( m_ContainerFile != null ) m_ContainerFile . renameTo ( oldFile ) ; if ( m_rootContainerElement != null ) { PrintStream attrStream = new PrintStream ( new FileOutputStream ( m_FileNameWithoutExtention + ".xml" ) ) ; JSpaceUtilities . domWriter ( m_rootContainerElement , attrStream , "" ) ; attrStream . close ( ) ; } if ( _logger . isLoggable ( Level . FINE ) ) { _logger . fine ( "The " + m_ContainerFile + " XML file for " + _containerName + " container has been updated" ) ; } } catch ( FileNotFoundException ex ) { if ( _logger . isLoggable ( Level . SEVERE ) ) { _logger . log ( Level . SEVERE , "FileNotFoundException: " , ex ) ; } } }
every change in container the container xml file will be updated using this method . on every update current file will be renamed to < % filename % > . old and the new one will be < % filename % > . xml
