bool TransferDirectoryContents(IActivityIOOperationsEndPoint src, IActivityIOOperationsEndPoint dst,
Dev2CRUDOperationTO args)
{
ValidateSourceAndDestinationContents(src, dst, args);
if(args.DoRecursiveCopy)
{
RecursiveCopy(src, dst, args);
}
var srcContents = src.ListFilesInDirectory(src.IOPath);
var result = true;
var origDstPath = Dev2ActivityIOPathUtils.ExtractFullDirectoryPath(dst.IOPath.Path);
if(!dst.PathExist(dst.IOPath))
{
CreateDirectory(dst, args);
}
// get each file, then put it to the correct location
// ReSharper disable once LoopCanBeConvertedToQuery
foreach(var p in srcContents)
{
result = PerformTransfer(src, dst, args, origDstPath, p, result);
}
Dev2Logger.Log.Debug(string.Format("Transfered: {0}", src.IOPath.Path));
return result;
}