Beispiel #1
0
 public static void AddEntry(DetailedLogFile logFile)
 {
     using (FileStream zipToOpen = new FileStream(logFile.ArchiveFolder, FileMode.Open))
     {
         using (ZipArchive archive = new ZipArchive(zipToOpen, ZipArchiveMode.Update))
         {
             archive.CreateEntry(logFile.LogFilePath);
         }
     }
 }
Beispiel #2
0
 public static void Compress(DetailedLogFile logFile, IZipFile zipWrapper)
 {
     if (logFile.ArchiveFolderExist)
     {
         AddEntry(logFile);
     }
     else
     {
         zipWrapper.CreateFromDirectory(logFile.LogFileDirectory, logFile.ArchiveFolder);
     }
 }
Beispiel #3
0
 public Dev2JsonStateLogger(IDSFDataObject dsfDataObject, IFile fileWrapper, IZipFile zipWrapper)
 {
     _dsfDataObject   = dsfDataObject;
     _fileWrapper     = fileWrapper;
     _zipWrapper      = zipWrapper;
     _detailedLogFile = new DetailedLogFile(_dsfDataObject, _fileWrapper);
     _writer          = GetDetailedLogWriter();
     _jsonTextWriter  = new JsonTextWriter(_writer.SynchronizedTextWriter)
     {
         CloseOutput = false,
     };
 }
Beispiel #4
0
 public static bool ShouldCompressFile(this IDev2WorkflowSettings settings, DetailedLogFile detailedLogFile)
 => detailedLogFile.LogFileAge > 2;