26 lines
743 B
C#
26 lines
743 B
C#
using System;
|
|
using FileCompression.Interfaces;
|
|
using FileCompression.Services.Strategies;
|
|
|
|
namespace FileCompression.Services.Composites;
|
|
|
|
public class FileCompressor : ICompressor
|
|
{
|
|
|
|
private string sourcePath;
|
|
private string destinationPath;
|
|
private string basePath;
|
|
private StrategyContext strategyContext;
|
|
public FileCompressor(string sourcePath, string destinationPath, string basePath, StrategyContext strategyContext)
|
|
{
|
|
this.sourcePath = sourcePath;
|
|
this.destinationPath = destinationPath;
|
|
this.strategyContext = strategyContext;
|
|
this.basePath = basePath;
|
|
}
|
|
public void Compress()
|
|
{
|
|
strategyContext.CompressFile(sourcePath, destinationPath, basePath);
|
|
}
|
|
}
|