-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathCxThinWrapper.java
More file actions
35 lines (28 loc) · 1.03 KB
/
CxThinWrapper.java
File metadata and controls
35 lines (28 loc) · 1.03 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
34
35
package com.checkmarx.ast.wrapper;
import lombok.NonNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class CxThinWrapper {
@NonNull
private final Logger logger;
@NonNull
private final String executable;
public CxThinWrapper() throws IOException {
this(LoggerFactory.getLogger(CxWrapper.class));
}
public CxThinWrapper(@NonNull Logger logger) throws IOException {
this.logger = logger;
this.executable = Execution.getTempBinary(logger);
this.logger.info("Executable path: {} ", executable);
}
public String run(@NonNull String arguments) throws CxException, IOException, InterruptedException {
this.logger.info("Executing commands with thin wrapper.");
List<String> argv = new ArrayList<>();
argv.add(executable);
argv.addAll(CxConfig.parseAdditionalParameters(arguments));
return Execution.executeCommand(argv, logger, line -> line);
}
}