Skip to content

Commit ff5ff31

Browse files
authored
Merge pull request #391 from DropSnorz/chore/default-scanner
Enable OwlPlug Scanner loader by default
2 parents f097dd0 + 9e4bd6b commit ff5ff31

File tree

5 files changed

+39
-13
lines changed

5 files changed

+39
-13
lines changed

owlplug-client/src/main/java/com/owlplug/plugin/services/NativeHostService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ public class NativeHostService extends BaseService {
4545

4646
@PostConstruct
4747
private void init() {
48-
pluginLoaders.add(JNINativePluginLoader.getInstance());
4948
pluginLoaders.add(EmbeddedScannerPluginLoader.getInstance());
49+
pluginLoaders.add(JNINativePluginLoader.getInstance());
5050
this.fallbackLoader = DummyPluginLoader.getInstance();
5151
pluginLoaders.add(fallbackLoader);
5252

owlplug-host/src/main/java/com/owlplug/host/io/ClassPathVersionUtils.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/* OwlPlug
2+
* Copyright (C) 2021 Arthur <[email protected]>
3+
*
4+
* This file is part of OwlPlug.
5+
*
6+
* OwlPlug is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License version 3
8+
* as published by the Free Software Foundation.
9+
*
10+
* OwlPlug is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with OwlPlug. If not, see <https://www.gnu.org/licenses/>.
17+
*/
18+
119
package com.owlplug.host.io;
220

321
import java.io.IOException;

owlplug-host/src/main/java/com/owlplug/host/loaders/EmbeddedScannerPluginLoader.java

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,6 @@ private EmbeddedScannerPluginLoader() {
7676
scannerId = DEFAULT_SCANNER_ID;
7777
}
7878

79-
public EmbeddedScannerPluginLoader usingScannerPath(String path) {
80-
this.scannerDirectory = path;
81-
return this;
82-
}
83-
84-
public EmbeddedScannerPluginLoader usingScannerId(String scannerId) {
85-
this.scannerId = scannerId;
86-
return this;
87-
}
88-
8979
@Override
9080
public void init() {
9181

@@ -135,7 +125,7 @@ public List<NativePlugin> loadPlugin(String path) {
135125
try {
136126
CommandRunner commandRunner = new CommandRunner();
137127
commandRunner.setTimeoutActivated(true);
138-
commandRunner.setTimeout(30000); // 30 seconds timeout
128+
commandRunner.setTimeout(10000); // 10 seconds timeout
139129
CommandResult result = commandRunner.run(scannerDirectory + SEPARATOR + scannerId, path);
140130
log.debug("Response received from scanner");
141131
log.debug(result.getOutput());

owlplug-host/src/main/java/com/owlplug/host/loaders/jni/JNINativePluginLoader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public String getName() {
7171

7272
@Override
7373
public String getId() {
74-
return "owlplug-jni";
74+
return "owlplug-jni-legacy";
7575
}
7676

7777
@Override

owlplug-host/src/main/java/com/owlplug/host/model/OS.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
/* OwlPlug
2+
* Copyright (C) 2021 Arthur <[email protected]>
3+
*
4+
* This file is part of OwlPlug.
5+
*
6+
* OwlPlug is free software: you can redistribute it and/or modify
7+
* it under the terms of the GNU General Public License version 3
8+
* as published by the Free Software Foundation.
9+
*
10+
* OwlPlug is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with OwlPlug. If not, see <https://www.gnu.org/licenses/>.
17+
*/
18+
119
package com.owlplug.host.model;
220

321
import java.util.Objects;

0 commit comments

Comments
 (0)