Beispiel #1
0
        private string ProcessAdditionalFile(AdditionalFile file)
        {
            if (string.IsNullOrWhiteSpace(file.FileName))
            {
                this.logger.LogDebug(Resources.RAP_AdditionalFileNameMustBeSpecified);
                return(null);
            }

            string fullPath = Path.Combine(this.sqSettings.SonarConfigDirectory, file.FileName);

            if (File.Exists(fullPath))
            {
                this.logger.LogDebug(Resources.RAP_AdditionalFileAlreadyExists, file.FileName, fullPath);
                return(null);
            }

            this.logger.LogDebug(Resources.RAP_WritingAdditionalFile, fullPath);
            File.WriteAllBytes(fullPath, file.Content ?? new byte[] { });
            return(fullPath);
        }
        private string ProcessAdditionalFile(AdditionalFile file)
        {
            if (string.IsNullOrWhiteSpace(file.FileName))
            {
                this.logger.LogDebug(Resources.SLAP_AdditionalFileNameMustBeSpecified);
                return null;
            }

            string fullPath = Path.Combine(this.settings.SonarConfigDirectory, file.FileName);
            if (File.Exists(fullPath))
            {
                this.logger.LogDebug(Resources.SLAP_AdditionalFileAlreadyExists, file.FileName, fullPath);
                return null;
            }

            this.logger.LogDebug(Resources.SLAP_WritingAdditionalFile, fullPath);
            File.WriteAllBytes(fullPath, file.Content ?? new byte[] { });
            return fullPath;
        }