/** * Fetch the users from the given api and commit each of them to the collector. * <p> * This differ from {@link #getUsersFromApi(ChannelInfoItemsCollector, String)} in the sense that they will always * get MIN_ITEMS or more. * * @param minItems the method will return only when it have extracted that many items (equal or more) */ public static String getUsersFromApiMinItems(int minItems, ChannelInfoItemsCollector collector, String apiUrl) throws IOException, ReCaptchaException, ParsingException { String nextPageUrl = SoundcloudParsingHelper.getUsersFromApi(collector, apiUrl); while (!nextPageUrl.isEmpty() && collector.getItems().size() < minItems) { nextPageUrl = SoundcloudParsingHelper.getUsersFromApi(collector, nextPageUrl); } return nextPageUrl; }