/
BlackDuckSignatureScannerOptions.java
177 lines (149 loc) · 5.93 KB
/
BlackDuckSignatureScannerOptions.java
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
/**
* synopsys-detect
*
* Copyright (c) 2020 Synopsys, Inc.
*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package com.synopsys.integration.detect.tool.signaturescanner;
import java.nio.file.Path;
import java.util.List;
import java.util.Optional;
import org.antlr.v4.runtime.misc.Nullable;
import com.synopsys.integration.blackduck.codelocation.signaturescanner.command.IndividualFileMatching;
import com.synopsys.integration.blackduck.codelocation.signaturescanner.command.SnippetMatching;
public class BlackDuckSignatureScannerOptions {
private final List<Path> signatureScannerPaths;
private final List<String> exclusionPatterns;
private final List<String> exclusionNamePatterns;
@Nullable
private final Path offlineLocalScannerInstallPath;
@Nullable
private final Path onlineLocalScannerInstallPath;
@Nullable
private final String userProvidedScannerInstallUrl;
private final Integer scanMemory;
private final Integer parallelProcessors;
private final Boolean dryRun;
@Nullable //Just to note that if you do not want snippet matching, this should be null.
private final SnippetMatching snippetMatching;
private final boolean uploadSource;
@Nullable
private final String codeLocationPrefix;
@Nullable
private final String codeLocationSuffix;
@Nullable
private final String additionalArguments;
private final Integer maxDepth;
@Nullable
private final IndividualFileMatching individualFileMatching;
private final Boolean licenseSearch;
private final Boolean copyrightSearch;
public BlackDuckSignatureScannerOptions(
final List<Path> signatureScannerPaths,
final List<String> exclusionPatterns,
final List<String> exclusionNamePatterns,
@Nullable final Path offlineLocalScannerInstallPath,
@Nullable final Path onlineLocalScannerInstallPath,
@Nullable final String userProvidedScannerInstallUrl,
final Integer scanMemory,
final Integer parallelProcessors,
final Boolean dryRun,
@Nullable final SnippetMatching snippetMatching,
@Nullable final Boolean uploadSource,
@Nullable final String codeLocationPrefix,
@Nullable final String codeLocationSuffix,
@Nullable final String additionalArguments,
final Integer maxDepth,
@Nullable final IndividualFileMatching individualFileMatching,
final Boolean licenseSearch,
final Boolean copyrightSearch) {
this.signatureScannerPaths = signatureScannerPaths;
this.exclusionPatterns = exclusionPatterns;
this.exclusionNamePatterns = exclusionNamePatterns;
this.offlineLocalScannerInstallPath = offlineLocalScannerInstallPath;
this.onlineLocalScannerInstallPath = onlineLocalScannerInstallPath;
this.userProvidedScannerInstallUrl = userProvidedScannerInstallUrl;
this.scanMemory = scanMemory;
this.parallelProcessors = parallelProcessors;
this.dryRun = dryRun;
this.snippetMatching = snippetMatching;
this.uploadSource = uploadSource;
this.codeLocationPrefix = codeLocationPrefix;
this.codeLocationSuffix = codeLocationSuffix;
this.additionalArguments = additionalArguments;
this.maxDepth = maxDepth;
this.individualFileMatching = individualFileMatching;
this.licenseSearch = licenseSearch;
this.copyrightSearch = copyrightSearch;
}
public List<Path> getSignatureScannerPaths() {
return signatureScannerPaths;
}
public List<String> getExclusionPatterns() {
return exclusionPatterns;
}
public List<String> getExclusionNamePatterns() {
return exclusionNamePatterns;
}
public Integer getScanMemory() {
return scanMemory;
}
public Integer getParallelProcessors() {
return parallelProcessors;
}
public Boolean getDryRun() {
return dryRun;
}
public Optional<SnippetMatching> getSnippetMatching() {
return Optional.ofNullable(snippetMatching);
}
public Boolean getUploadSource() {
return uploadSource;
}
public Optional<String> getCodeLocationPrefix() {
return Optional.ofNullable(codeLocationPrefix);
}
public Optional<String> getCodeLocationSuffix() {
return Optional.ofNullable(codeLocationSuffix);
}
public Optional<String> getAdditionalArguments() {
return Optional.ofNullable(additionalArguments);
}
public Integer getMaxDepth() {
return maxDepth;
}
public Optional<Path> getOfflineLocalScannerInstallPath() {
return Optional.ofNullable(offlineLocalScannerInstallPath);
}
public Optional<Path> getOnlineLocalScannerInstallPath() {
return Optional.ofNullable(onlineLocalScannerInstallPath);
}
public Optional<String> getUserProvidedScannerInstallUrl() {
return Optional.ofNullable(userProvidedScannerInstallUrl);
}
public Optional<IndividualFileMatching> getIndividualFileMatching() {
return Optional.ofNullable(individualFileMatching);
}
public Boolean getLicenseSearch() {
return licenseSearch;
}
public Boolean getCopyrightSearch() {
return copyrightSearch;
}
}