Minor corrections to avoid empty replies exceptions

This commit is contained in:
Spyros Zoupanos 2020-10-15 22:08:24 +03:00
parent a1dc930486
commit 6cc58e2720
2 changed files with 8 additions and 4 deletions

View File

@ -219,7 +219,7 @@ public class LaReferenciaDownloadLogs {
int i = 0;
JSONParser parser = new JSONParser();
while (!content.equals("[]")) {
do {
String apiUrl = baseApiUrl;
if (i > 0) {
@ -227,6 +227,8 @@ public class LaReferenciaDownloadLogs {
}
content = getJson(apiUrl);
if (content.length() == 0 || content.equals("[]"))
break;
JSONArray jsonArray = (JSONArray) parser.parse(content);
for (Object aJsonArray : jsonArray) {
@ -241,7 +243,7 @@ public class LaReferenciaDownloadLogs {
+ " and for "
+ sdf.format(date));
i++;
}
} while (true);
fin.close();
}

View File

@ -163,7 +163,7 @@ public class PiwikDownloadLogs {
int i = 0;
JSONParser parser = new JSONParser();
while (!content.equals("[]")) {
do {
String apiUrl = baseApiUrl;
if (i > 0) {
@ -171,6 +171,8 @@ public class PiwikDownloadLogs {
}
content = getJson(apiUrl);
if (content.length() == 0 || content.equals("[]"))
break;
JSONArray jsonArray = (JSONArray) parser.parse(content);
for (Object aJsonArray : jsonArray) {
@ -180,7 +182,7 @@ public class PiwikDownloadLogs {
}
i++;
}
} while (true);
fin.close();
}