static bool PerformTransfer(IActivityIOOperationsEndPoint src, IActivityIOOperationsEndPoint dst, Dev2CRUDOperationTO args, string origDstPath, IActivityIOPath p, bool result)
{
try
{
if(dst.PathIs(dst.IOPath) == enPathType.Directory)
{
var cpPath =
ActivityIOFactory.CreatePathFromString(
string.Format("{0}{1}{2}", 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.Log.Error(ex);
}
return result;
}