예제 #1
0
    public JsonCycloneDx ToJson(string filePath)
    {
        try
        {
            using var stream = new StreamReader(filePath);

            return(JsonCycloneDx.FromJson(stream.ReadToEnd()) ?? throw new InvalidOperationException());
        }
        catch (IOException)
        {
            throw new ArgumentException("Can not read file, location given: " + filePath);
        }
    }
예제 #2
0
 public JsonCycloneDx ToJson(string filePath) =>
 JsonCycloneDx.FromJson(_jsonString) ?? throw new InvalidOperationException();