WindowsPathAdjuster
using Relativity.DataTransfer.Nodes.PathConversion;
namespace Relativity.DataTransfer.Nodes.Internal.Utilities
{
internal class WindowsPathAdjuster : IPathAdjuster
{
private readonly ICanonicalFormConverterFactory _canonicalFormConverterFactory;
public WindowsPathAdjuster(ICanonicalFormConverterFactory canonicalFormConverterFactory)
{
_canonicalFormConverterFactory = canonicalFormConverterFactory;
}
public string Adjust(string path)
{
string text = FixDots(path);
ICanonicalFormConverter canonicalFormConverter = _canonicalFormConverterFactory.Create(text);
return canonicalFormConverter.Convert(text);
}
private static string FixDots(string path)
{
return path.TrimStart(new char[1] {
'.'
});
}
}
}