CanonicalFormConverterFactory
namespace Relativity.DataTransfer.Nodes.PathConversion
{
public class CanonicalFormConverterFactory : ICanonicalFormConverterFactory
{
public ICanonicalFormConverter Create(string path)
{
object result;
if (!IsRemotePath(path)) {
ICanonicalFormConverter canonicalFormConverter = new LocalCanonicalFormConverter();
result = canonicalFormConverter;
} else {
ICanonicalFormConverter canonicalFormConverter = new RemoteCanonicalFormConverter();
result = canonicalFormConverter;
}
return (ICanonicalFormConverter)result;
}
private static bool IsRemotePath(string path)
{
return (path.StartsWith(PathConstants.DirectorySeparatorAsString) || path.StartsWith(PathConstants.UnixDirectorySeparator)) && !path.StartsWith(PathConstants.UncPathShortPrefix);
}
}
}