|
a/src/main/java/net/timbusproject/extractors/debiansoftwareextractor/DebianSoftwareExtractor.java |
|
b/src/main/java/net/timbusproject/extractors/debiansoftwareextractor/DebianSoftwareExtractor.java |
|
... |
|
... |
63 |
parameters.put("fqdn", new Parameter(false, true));
|
63 |
parameters.put("fqdn", new Parameter(false, true));
|
64 |
parameters.put("port", new Parameter(false, false, ParameterType.NUMBER));
|
64 |
parameters.put("port", new Parameter(false, false, ParameterType.NUMBER));
|
65 |
parameters.put("user", new Parameter(false, true));
|
65 |
parameters.put("user", new Parameter(false, true));
|
66 |
parameters.put("password", new Parameter(true, false));
|
66 |
parameters.put("password", new Parameter(true, false));
|
67 |
parameters.put("privateKey", new Parameter(true, false, ParameterType.FILE));
|
67 |
parameters.put("privateKey", new Parameter(true, false, ParameterType.FILE));
|
|
|
68 |
try {
|
|
|
69 |
parameters.put("privateKey", new Parameter(true, false, ParameterType.valueOf("FILE")));
|
|
|
70 |
} catch (IllegalArgumentException ignored) {}
|
68 |
return parameters;
|
71 |
return parameters;
|
69 |
}
|
72 |
}
|
70 |
|
73 |
|
71 |
@Override
|
74 |
@Override
|
72 |
public String extract(Endpoint endpoint, boolean b) throws Exception {
|
75 |
public String extract(Endpoint endpoint, boolean b) throws Exception {
|
73 |
/*
|
|
|
74 |
FileInputStream knownHosts;
|
|
|
75 |
try {
|
|
|
76 |
knownHosts = endpoint.hasProperty("knownHosts") && endpoint.getProperty("knownHosts") != null
|
|
|
77 |
&& !endpoint.getProperty("knownHosts").isEmpty()
|
|
|
78 |
? new FileInputStream(endpoint.getProperty("knownHosts")) : null;
|
|
|
79 |
} catch (FileNotFoundException e) { knownHosts = null; }
|
|
|
80 |
*/
|
|
|
81 |
SSHManager sshManager = new SSHManager(
|
76 |
SSHManager sshManager = new SSHManager(
|
82 |
endpoint.getProperty("user"),
|
77 |
endpoint.getProperty("user"),
|
83 |
endpoint.getProperty("fqdn"),
|
78 |
endpoint.getProperty("fqdn"),
|
84 |
endpoint.hasProperty("port") ? Integer.parseInt(endpoint.getProperty("port")) : Endpoint.DEFAULT_SSH_PORT,
|
79 |
endpoint.hasProperty("port") ? Integer.parseInt(endpoint.getProperty("port")) : Endpoint.DEFAULT_SSH_PORT,
|
85 |
endpoint.getProperty("privateKey")
|
80 |
endpoint.getProperty("privateKey")
|