ErrorFileDestinationPath
using kCura.WinEDDS;
using kCura.WinEDDS.Exceptions;
using Relativity.DataExchange.Io;
using Relativity.DataExchange.Logger;
using Relativity.Logging;
using System.Text;
namespace Relativity.DataExchange.Export.VolumeManagerV2.Metadata.Paths
{
public class ErrorFileDestinationPath : IDestinationPath, IErrorFile
{
private string _errorFilePath;
private readonly ExportFile _exportSettings;
private readonly ILog _logger;
public string Path {
get {
if (string.IsNullOrEmpty(_errorFilePath)) {
_errorFilePath = TempFileBuilder.GetTempFileName("rel-errors");
_logger.LogVerbose("Creating new path {path} for error file.", new object[1] {
_errorFilePath.Secure()
});
}
return _errorFilePath;
}
}
public Encoding Encoding => _exportSettings.LoadFileEncoding;
public FileWriteException.DestinationFile DestinationFileType => FileWriteException.DestinationFile.Errors;
public ErrorFileDestinationPath(ExportFile exportSettings, ILog logger)
{
_exportSettings = exportSettings;
_logger = logger;
}
public bool IsErrorFileCreated()
{
return !string.IsNullOrEmpty(_errorFilePath);
}
string IErrorFile.Path()
{
return Path;
}
}
}