mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-01-03 11:54:13 +00:00
7e7ab30808
Does not depend on ServalDResult class - appends output fields to a supplied list instead, and returns the integer status Does not depend on ServalDReentranceError class - uses java.lang.IllegalStateException instead
34 lines
600 B
Java
34 lines
600 B
Java
package org.servalproject.servald;
|
|
|
|
import java.util.List;
|
|
import java.util.LinkedList;
|
|
|
|
class ServalD
|
|
{
|
|
int status;
|
|
List<String> outv;
|
|
|
|
public ServalD()
|
|
{
|
|
System.loadLibrary("servald");
|
|
}
|
|
|
|
public native int rawCommand(List<String> outv, String... args);
|
|
|
|
public void command(String... args)
|
|
{
|
|
this.outv = new LinkedList<String>();
|
|
this.status = this.rawCommand(this.outv, args);
|
|
}
|
|
|
|
public static void main(String[] args)
|
|
{
|
|
ServalD servald = new ServalD();
|
|
servald.command(args);
|
|
for (String s: servald.outv) {
|
|
System.out.println(s);
|
|
}
|
|
System.exit(servald.status);
|
|
}
|
|
}
|