Changed parsing of =var variables to handle multi-line results better

This commit is contained in:
GideonLeGrange 2014-12-22 15:56:35 +02:00
parent 2a450e260c
commit cddb19d11f
2 changed files with 0 additions and 38 deletions

View File

@ -1,28 +0,0 @@
package examples;
import java.util.List;
import java.util.Map;
import me.legrange.mikrotik.MikrotikApiException;
/**
* Example 7: Dump your complete config
*
* @author gideon
*/
public class Example8 extends Example {
public static void main(String... args) throws Exception {
Example8 ex = new Example8();
ex.connect();
ex.test();
ex.disconnect();
}
private void test() throws MikrotikApiException, InterruptedException {
List<Map<String, String>> res = con.execute("/ip/hotspot/user/print where uptime!=1");
for (Map<String, String> r : res) {
System.out.println(r);
}
// con.execute("/ip/firewall/filter/add chain=forward hotspot=!auth protocol=tcp src-port=8000-8084");
}
}

View File

@ -394,16 +394,6 @@ public final class ApiConnectionImpl extends ApiConnection {
} }
return buf.toString(); return buf.toString();
} }
private String unpackMultiLine(String head) throws ApiConnectionException, ApiDataException {
StringBuilder buf = new StringBuilder(head);
do {
nextLine();
buf.append(line);
} while (line.endsWith("\r"));
return buf.toString();
}
private Done unpackDone() throws MikrotikApiException { private Done unpackDone() throws MikrotikApiException {
Done done = new Done(null); Done done = new Done(null);