示例#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);
         }
     }
 }
示例#2
0
 public static void Compress(DetailedLogFile logFile, IZipFile zipWrapper)
 {
     if (logFile.ArchiveFolderExist)
     {
         AddEntry(logFile);
     }
     else
     {
         zipWrapper.CreateFromDirectory(logFile.LogFileDirectory, logFile.ArchiveFolder);
     }
 }
示例#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,
     };
 }
示例#4
0
 public static bool ShouldCompressFile(this IDev2WorkflowSettings settings, DetailedLogFile detailedLogFile)
 => detailedLogFile.LogFileAge > 2;