这是我从不同的 URL 获取多个列表然后将不同的列表排序到单个 ArrayList 的方法。来自不同日历的 Arraylist 具有不同的 EMAIL 和 OWNER NAME。在这种方法中,我只返回一个 ArrayList。如何获取每个 ArrayList 的 EMAIL 和 OWNNER NAME?
public List<ArrayList> getEventsSort(Filter filter, String uri, Sardine sardine,
List<String> emailShare) throws IOException, ParserException {
List eventsToday = null;
List arrayList = new ArrayList<String>();
for (String email : emailShare) {
String uris = uri + email + "/events/";
InputStream stream = null;
try {
stream = sardine.get(uris);
BufferedReader br = new BufferedReader(new InputStreamReader(
stream));
CalendarBuilder builder = new CalendarBuilder();
net.fortuna.ical4j.model.Calendar calendar = builder.build(br);
eventsToday = (List<?>) filter.filter(calendar
.getComponents(Component.VEVENT));
arrayList.addAll(eventsToday);
} finally {
IOUtils.closeQuietly(stream);
}
}
getSortList(arrayList);
return arrayList;
}