public Collection getCounts(Date[] dates, Date[] takenDates)
throws IOException, SAXException, FlickrException {
List photocounts = new ArrayList();
List parameters = new ArrayList();
parameters.add(new Parameter("method", METHOD_GET_COUNTS));
parameters.add(new Parameter("api_key", apiKey));
if (dates == null && takenDates == null) {
throw new IllegalArgumentException("You must provide a value for either dates or takenDates");
}
if (dates != null) {
List dateList = new ArrayList();
for (int i = 0; i < dates.length; i++) {
dateList.add(String.valueOf(dates[i].getTime() / 1000L));
}
parameters.add(new Parameter("dates", StringUtilities.join(dateList, ",")));
}
if (takenDates != null) {
List takenDateList = new ArrayList();
for (int i = 0; i < takenDates.length; i++) {
takenDateList.add(String.valueOf(takenDates[i].getTime() / 1000L));
}
parameters.add(new Parameter("taken_dates", StringUtilities.join(takenDateList, ",")));
}
parameters.add(
new Parameter(
"api_sig",
AuthUtilities.getSignature(sharedSecret, parameters)
)
);