forked from D-Net/dnet-hadoop
Minor corrections to avoid empty replies exceptions
This commit is contained in:
parent
a1dc930486
commit
6cc58e2720
|
@ -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();
|
||||
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue