AppUpdater.Publisher.Program.ValidateArgs C# (CSharp) Method

ValidateArgs() private method

private ValidateArgs ( ) : void
return void
        private void ValidateArgs()
        {
            StringBuilder sb = new StringBuilder();
            if (String.IsNullOrWhiteSpace(sourceDirectory))
            {
                sb.AppendLine("The 'source' argument is required.");
            }
            else
            {
                sourceDirectoryPath = Path.GetFullPath(sourceDirectory);
                if (!Directory.Exists(sourceDirectoryPath))
                {
                    throw new Exception(String.Format("The directory '{0}' could not be found.", sourceDirectoryPath));
                }
            }

            if (String.IsNullOrWhiteSpace(targetDirectory))
            {
                sb.AppendLine("The 'target' argument is required.");
            }
            else
            {
                targetDirectoryPath = Path.GetFullPath(targetDirectory);
                if (!Directory.Exists(targetDirectoryPath))
                {
                    throw new Exception(String.Format("The directory '{0}' could not be found.", targetDirectoryPath));
                }
            }

            if (String.IsNullOrWhiteSpace(version))
            {
                sb.AppendLine("The 'version' argument is required.");
            }

            if (sb.Length > 0)
            {
                throw new Exception(sb.ToString());
            }
        }