} else { photoSetList = photosetsInterface.getPhotos( photoSetId, ImmutableSet.copyOf(EXTRAS), 0, PHOTO_PER_PAGE, page);
photosetsInterface.getList( auth.getUser().getId(), PHOTO_SETS_PER_PAGE, page, PHOTOSET_EXTRAS); } catch (FlickrException e) {
@Override protected PhotoList<Photo> flickrProcess(String path) { try { final PhotosetsInterface setsInterface = flickr.getPhotosetsInterface(); final Matcher matcher = r.matcher(path); matcher.find(); final String setId = matcher.group(1); final Photoset set = setsInterface.getInfo(setId); return setsInterface.getPhotos(setId, set.getPhotoCount(), 0); } catch (final Exception e) { e.printStackTrace(); } return null; } }
Photoset photoset = FlickrTestUtils.initializePhotoset(FLICKR_ALBUM_ID, ALBUM_DESCRIPTION, FLICKR_PHOTO_ID); when(photosetsInterface.create(flickrAlbumTitle, ALBUM_DESCRIPTION, FLICKR_PHOTO_ID)) .thenReturn(photoset); verify(photosetsInterface).create(flickrAlbumTitle, ALBUM_DESCRIPTION, FLICKR_PHOTO_ID);
@Override public PhotosetsInterface getPhotosetsInterface() { if (photosetsInterface == null) { photosetsInterface = new PhotosetsInterface(apiKey, sharedSecret, transport); } return photosetsInterface; }
@Override public PhotosetsInterface getPhotosetsInterface() { if (photosetsInterface == null) { photosetsInterface = new PhotosetsInterface(apiKey, sharedSecret, transport); } return photosetsInterface; }
photosList.setPages(page + 1); when(photosetsInterface.getPhotos(anyString(), anySet(), anyInt(), anyInt(), anyInt())) .thenReturn(photosList);
photosetsList.setPages(page + 1); photosetsList.setPhotosets(Collections.singletonList(photoset)); when(photosetsInterface.getList(anyString(), anyInt(), anyInt(), anyString())) .thenReturn(photosetsList);
/** * Convenience method. * * Calls getPhotos() with Extras.MIN_EXTRAS and Flickr.PRIVACY_LEVEL_NO_FILTER. * * This method does not require authentication. * * @see com.flickr4java.flickr.photos.Extras * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_NO_FILTER * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_PUBLIC * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_FRIENDS * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_FRIENDS_FAMILY * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_FAMILY * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_FRIENDS * @param photosetId * The photoset ID * @param perPage * The number of photos per page * @param page * The page offset * @return PhotoList The Collection of Photo objects * @throws FlickrException */ public PhotoList<Photo> getPhotos(String photosetId, int perPage, int page) throws FlickrException { return getPhotos(photosetId, Extras.MIN_EXTRAS, Flickr.PRIVACY_LEVEL_NO_FILTER, perPage, page); }
/** * Get a list of all photosets for the specified user. * * This method does not require authentication. But to get a Photoset into the list, that contains just private photos, the call needs to be authenticated. * * @param userId * The User id * @return The Photosets collection * @throws FlickrException */ public Photosets getList(String userId) throws FlickrException { return getList(userId, 0, 0, null); }
/** * Convenience method. * * Calls getPhotos() with Extras.MIN_EXTRAS and Flickr.PRIVACY_LEVEL_NO_FILTER. * * This method does not require authentication. * * @see com.flickr4java.flickr.photos.Extras * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_NO_FILTER * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_PUBLIC * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_FRIENDS * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_FRIENDS_FAMILY * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_FAMILY * @see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_FRIENDS * @param photosetId * The photoset ID * @param perPage * The number of photos per page * @param page * The page offset * @return PhotoList The Collection of Photo objects * @throws FlickrException */ public PhotoList<Photo> getPhotos(String photosetId, int perPage, int page) throws FlickrException { return getPhotos(photosetId, Extras.MIN_EXTRAS, Flickr.PRIVACY_LEVEL_NO_FILTER, perPage, page); }
/** * Get a list of all photosets for the specified user. * * This method does not require authentication. But to get a Photoset into the list, that contains just private photos, the call needs to be authenticated. * * @param userId * The User id * @param primaryPhotoExtras * A comma-delimited list of extra information to fetch for the primary photo * @return The Photosets collection * @throws FlickrException */ public Photosets getList(String userId, String primaryPhotoExtras) throws FlickrException { return getList(userId, 0, 0, primaryPhotoExtras); }
/** * Get a list of all photosets for the specified user. * * This method does not require authentication. But to get a Photoset into the list, that contains just private photos, the call needs to be authenticated. * * @param userId * The User id * @return The Photosets collection * @throws FlickrException */ public Photosets getList(String userId) throws FlickrException { return getList(userId, 0, 0, null); }
/** * Get a list of all photosets for the specified user. * * This method does not require authentication. But to get a Photoset into the list, that contains just private photos, the call needs to be authenticated. * * @param userId * The User id * @param primaryPhotoExtras * A comma-delimited list of extra information to fetch for the primary photo * @return The Photosets collection * @throws FlickrException */ public Photosets getList(String userId, String primaryPhotoExtras) throws FlickrException { return getList(userId, 0, 0, primaryPhotoExtras); }