files as json arrays
This commit is contained in:
parent
de287679c8
commit
e9a31f367a
|
@ -84,7 +84,9 @@ public class BrokerUtils {
|
||||||
|
|
||||||
String url = baseUrl + "/scroll/notifications/bySubscriptionId/" + URLEncoder.encode(subscrId, StandardCharsets.UTF_8.name());
|
String url = baseUrl + "/scroll/notifications/bySubscriptionId/" + URLEncoder.encode(subscrId, StandardCharsets.UTF_8.name());
|
||||||
boolean notCompleted = false;
|
boolean notCompleted = false;
|
||||||
|
boolean first = true;
|
||||||
|
|
||||||
|
file.append("[\n");
|
||||||
do {
|
do {
|
||||||
log.info("Performing HTTP GET for notifications: " + url);
|
log.info("Performing HTTP GET for notifications: " + url);
|
||||||
final HttpGet request = new HttpGet(url);
|
final HttpGet request = new HttpGet(url);
|
||||||
|
@ -95,8 +97,12 @@ public class BrokerUtils {
|
||||||
|
|
||||||
final JSONArray values = data.getJSONArray("values");
|
final JSONArray values = data.getJSONArray("values");
|
||||||
for (int i = 0; i < values.length(); i++) {
|
for (int i = 0; i < values.length(); i++) {
|
||||||
|
if (first) {
|
||||||
|
first = false;
|
||||||
|
} else {
|
||||||
|
file.append(",\n");
|
||||||
|
}
|
||||||
file.append(values.getJSONObject(i).toString());
|
file.append(values.getJSONObject(i).toString());
|
||||||
file.append("\n");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
notCompleted = !data.getBoolean("completed");
|
notCompleted = !data.getBoolean("completed");
|
||||||
|
@ -105,6 +111,8 @@ public class BrokerUtils {
|
||||||
System.out.print(".");
|
System.out.print(".");
|
||||||
System.out.flush();
|
System.out.flush();
|
||||||
} while (notCompleted);
|
} while (notCompleted);
|
||||||
|
|
||||||
|
file.append("\n]\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
private String extractDsName(final JSONArray conds) {
|
private String extractDsName(final JSONArray conds) {
|
||||||
|
|
Loading…
Reference in New Issue