NullIoReporter
Represents a null design pattern for occasions where a valid IIoReporter is referenced but whose functionality isn't actually used or required. This class cannot be inherited.
using System;
namespace Relativity.DataExchange.Io
{
internal sealed class NullIoReporter : IIoReporter
{
private readonly IFileSystem fileSystem;
public NullIoReporter(IFileSystem fileSystem)
{
if (fileSystem == null)
throw new ArgumentNullException("fileSystem");
this.fileSystem = fileSystem;
}
public void CopyFile(string sourceFileName, string destFileName, bool overwrite, int lineNumber)
{
fileSystem.File.Copy(sourceFileName, destFileName, overwrite);
}
public bool GetFileExists(string fileName, int lineNumber)
{
return fileSystem.CreateFileInfo(fileName).Exists;
}
public long GetFileLength(string fileName, int lineNumber)
{
return fileSystem.CreateFileInfo(fileName).Length;
}
public void PublishRetryMessage(Exception exception, TimeSpan timeSpan, int retryCount, int totalRetryCount, long lineNumber)
{
}
public void PublishWarningMessage(IoWarningEventArgs args)
{
}
}
}