Exemple #1
0
 /// <exception cref="System.IO.IOException"></exception>
 public override PackLock Parse(ProgressMonitor receiving, ProgressMonitor resolving
                                )
 {
     tmpPack = FilePath.CreateTempFile("incoming_", ".pack", db.GetDirectory());
     tmpIdx  = new FilePath(db.GetDirectory(), BaseName(tmpPack) + ".idx");
     try
     {
         @out = new RandomAccessFile(tmpPack, "rw");
         base.Parse(receiving, resolving);
         @out.Seek(packEnd);
         @out.Write(packHash);
         @out.GetChannel().Force(true);
         @out.Close();
         WriteIdx();
         tmpPack.SetReadOnly();
         tmpIdx.SetReadOnly();
         return(RenameAndOpenPack(GetLockMessage()));
     }
     finally
     {
         if (def != null)
         {
             def.Finish();
         }
         try
         {
             if (@out != null && @out.GetChannel().IsOpen())
             {
                 @out.Close();
             }
         }
         catch (IOException)
         {
         }
         // Ignored. We want to delete the file.
         CleanupTemporaryFiles();
     }
 }
 /// <exception cref="System.IO.IOException"></exception>
 internal virtual FilePath NewTempFile()
 {
     return(FilePath.CreateTempFile("noz", null, db.GetDirectory()));
 }