public PhotoList getPhotos(String groupId, String[] tags, Set extras, int perPage, int page)
throws IOException, SAXException, FlickrException {
PhotoList photos = new PhotoList();
List parameters = new ArrayList();
parameters.add(new Parameter("method", METHOD_GET_PHOTOS));
parameters.add(new Parameter("api_key", apiKey));
parameters.add(new Parameter("group_id", groupId));
if (tags != null) {
parameters.add(new Parameter("tags", StringUtilities.join(tags, " ")));
}
if (perPage > 0) {
parameters.add(new Parameter("per_page", new Integer(perPage)));
}
if (page > 0) {
parameters.add(new Parameter("page", new Integer(page)));
}
if (extras != null) {
StringBuffer sb = new StringBuffer();
Iterator it = extras.iterator();
for (int i = 0; it.hasNext(); i++) {
if (i > 0) {
sb.append(",");
}
sb.append(it.next());
}
parameters.add(new Parameter(Extras.KEY_EXTRAS, sb.toString()));
}
parameters.add(
new Parameter(
"api_sig",
AuthUtilities.getSignature(sharedSecret, parameters)
)
);