-
Notifications
You must be signed in to change notification settings - Fork 123
Expand file tree
/
Copy pathBinarySyftRunnerFactory.cs
More file actions
33 lines (29 loc) · 1.21 KB
/
BinarySyftRunnerFactory.cs
File metadata and controls
33 lines (29 loc) · 1.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
namespace Microsoft.ComponentDetection.Detectors.Linux;
using Microsoft.ComponentDetection.Contracts;
using Microsoft.Extensions.Logging;
/// <summary>
/// Factory for creating <see cref="BinarySyftRunner"/> instances.
/// </summary>
internal class BinarySyftRunnerFactory : IBinarySyftRunnerFactory
{
private readonly ICommandLineInvocationService commandLineInvocationService;
private readonly ILoggerFactory loggerFactory;
/// <summary>
/// Initializes a new instance of the <see cref="BinarySyftRunnerFactory"/> class.
/// </summary>
/// <param name="commandLineInvocationService">The command line invocation service.</param>
/// <param name="loggerFactory">The logger factory.</param>
public BinarySyftRunnerFactory(
ICommandLineInvocationService commandLineInvocationService,
ILoggerFactory loggerFactory)
{
this.commandLineInvocationService = commandLineInvocationService;
this.loggerFactory = loggerFactory;
}
/// <inheritdoc/>
public ISyftRunner Create(string binaryPath) =>
new BinarySyftRunner(
binaryPath,
this.commandLineInvocationService,
this.loggerFactory.CreateLogger<BinarySyftRunner>());
}