AsperaUncBcpPathResolver
using Relativity.Transfer.Aspera.Resources;
using System;
namespace Relativity.Transfer.Aspera
{
public class AsperaUncBcpPathResolver : RemotePathResolverBase
{
private string bcpUncPath;
public string BcpUncPath {
get {
return bcpUncPath;
}
set {
if (!string.IsNullOrEmpty(value))
value = RemotePathResolverBase.FileSystemService.TrimTrailingSlash(value);
bcpUncPath = value;
}
}
public string RootFolder { get; set; }
public AsperaUncBcpPathResolver(ITransferLog transferLog)
: this(string.Empty, string.Empty, transferLog)
{
}
public AsperaUncBcpPathResolver(string bcpUncPath, string rootFolder, ITransferLog transferLog)
: base(transferLog)
{
BcpUncPath = bcpUncPath;
RootFolder = rootFolder;
}
protected override string OnResolvePath(string path)
{
if (string.IsNullOrEmpty(path))
throw new ArgumentNullException("path");
string text = PathHelper.NormalizeUnixPath(RootFolder);
if (!RemotePathResolverBase.FileSystemService.IsUnixPath(text) && GlobalSettings.Instance.ValidateResolvedPaths) {
transferLog.LogError(AsperaStrings.AsperaUncPathResolverNotUnixPathExceptionMessage, RootFolder, path, LogRedaction.OnPositions(default(int)));
throw new TransferException(AsperaStrings.GeneralOperationErrorCheckLogs, true);
}
return text;
}
}
}