string ValidateUnzipSourceDestinationFileOperation(IActivityIOOperationsEndPoint src,
IActivityIOOperationsEndPoint dst,
Dev2UnZipOperationTO args,
Func<string> performAfterValidation)
{
ValidateSourceAndDestinationPaths(src, dst);
if(dst.PathIs(dst.IOPath) != enPathType.Directory)
{
throw new Exception("Destination must be a directory");
}
if(src.PathIs(src.IOPath) != enPathType.File)
{
throw new Exception("Source must be a file");
}
if(!args.Overwrite && dst.PathExist(dst.IOPath))
{
throw new Exception("Destination directory already exists and overwrite is set to false");
}
return performAfterValidation();
}