string ValidateRenameSourceAndDesinationTypes(IActivityIOOperationsEndPoint src,
IActivityIOOperationsEndPoint dst,
Dev2CRUDOperationTO args)
{
//ensures that the source and destination locations are of the same type
if(src.PathIs(src.IOPath) != dst.PathIs(dst.IOPath))
{
throw new Exception("Source and destination need to be both files or directories");
}
//Rename Tool if the file/folder exists then delete it and put the source there
if(dst.PathExist(dst.IOPath))
{
if(!args.Overwrite)
{
throw new Exception("Destination directory already exists and overwrite is set to false");
}
//Clear the existing folder
dst.Delete(dst.IOPath);
}
return Move(src, dst, args);
}