bool PerformTransfer(IActivityIOOperationsEndPoint src, IActivityIOOperationsEndPoint dst, IDev2CRUDOperationTO args, string origDstPath, IActivityIOPath p, bool result)
{
try
{
if (dst.PathIs(dst.IOPath) == enPathType.Directory)
{
var cpPath =
ActivityIOFactory.CreatePathFromString(
$"{origDstPath}{dst.PathSeperator()}{Dev2ActivityIOPathUtils.ExtractFileName(p.Path)}",
dst.IOPath.Username,
dst.IOPath.Password, true, dst.IOPath.PrivateKeyFile);
var path = cpPath.Path;
DoFileTransfer(src, dst, args, cpPath, p, path, ref result);
}
else
{
if (args.Overwrite || !dst.PathExist(dst.IOPath))
{
var tmp = origDstPath + @"\\" + Dev2ActivityIOPathUtils.ExtractFileName(p.Path);
var path = ActivityIOFactory.CreatePathFromString(tmp, dst.IOPath.Username, dst.IOPath.Password, dst.IOPath.PrivateKeyFile);
DoFileTransfer(src, dst, args, path, p, path.Path, ref result);
}
}
}
catch (Exception ex)
{
Dev2Logger.Error(ex, GlobalConstants.WarewolfError);
}
return(result);
}