private void SetIgnoreObject()
 {
     try
     {
         string ignoreFilePath = File.ReadAllText(IgnoreFile);
         _ignoreObject = JsonConvert.DeserializeObject <IgnoreObject>(ignoreFilePath);
     }
     catch (IOException)
     {
         throw new XamarinSecurityScannerException($"Could not read ignore file: {IgnoreFile}.");
     }
     catch (JsonException)
     {
         throw new XamarinSecurityScannerException($"Could not parse ignore file: {IgnoreFile}.");
     }
 }
Ejemplo n.º 2
0
        private void SetIgnoreObject()
        {
            try
            {
                var options = new JsonSerializerOptions
                {
                    PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
                };

                string ignoreText = File.ReadAllText(IgnoreFile);
                _ignoreObject = JsonSerializer.Deserialize <IgnoreObject>(ignoreText, options);
            }
            catch (IOException)
            {
                throw new XamarinSecurityScannerException($"Could not read ignore file: {IgnoreFile}.");
            }
            catch (JsonException)
            {
                throw new XamarinSecurityScannerException($"Could not parse ignore file: {IgnoreFile}.");
            }
        }