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