public static Photoset initializePhotoset(String id, String title, String description) { Photoset photoset = new Photoset(); photoset.setId(id); photoset.setTitle(title); photoset.setDescription(description); return photoset; }
photosetsInterface.getList( auth.getUser().getId(), PHOTO_SETS_PER_PAGE, page, PHOTOSET_EXTRAS); } catch (FlickrException e) { for (Photoset photoSet : photoSetList.getPhotosets()) { new PhotoAlbum(photoSet.getId(), photoSet.getTitle(), photoSet.getDescription())); subResources.add(new IdOnlyContainerResource(photoSet.getId())); photoSetList.getPage() != photoSetList.getPages() && !photoSetList.getPhotosets().isEmpty(); if (hasMore) { newPage = new IntPaginationToken(page + 1);
Photosets photosetsList = new Photosets(); photosetsList.setPage(page); photosetsList.setPages(page + 1); photosetsList.setPhotosets(Collections.singletonList(photoset)); when(photosetsInterface.getList(anyString(), anyInt(), anyInt(), anyString())) .thenReturn(photosetsList);
} else { photoSetList = photosetsInterface.getPhotos( photoSetId, ImmutableSet.copyOf(EXTRAS), 0, PHOTO_PER_PAGE, 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); }
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; }
public void setPhotoCount(String photoCount) { if (photoCount != null) { setPhotoCount(Integer.parseInt(photoCount)); } }
/** * * @param childPhotosetElement * @return */ private Photoset createPhotoset(Element childPhotosetElement) { Photoset photoset = new Photoset(); photoset.setId(childPhotosetElement.getAttribute("id")); photoset.setTitle(childPhotosetElement.getAttribute("title")); photoset.setDescription(childPhotosetElement.getAttribute("description")); return photoset; }
photosList.setPages(page + 1); when(photosetsInterface.getPhotos(anyString(), anySet(), anyInt(), anyInt(), anyInt())) .thenReturn(photosList);
/** * 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); }
@Override public PhotosetsInterface getPhotosetsInterface() { if (photosetsInterface == null) { photosetsInterface = new PhotosetsInterface(apiKey, sharedSecret, transport); } return photosetsInterface; }
public void setPhotoCount(String photoCount) { if (photoCount != null) { setPhotoCount(Integer.parseInt(photoCount)); } }
/** * * @param childPhotosetElement * @return */ private Photoset createPhotoset(Element childPhotosetElement) { Photoset photoset = new Photoset(); photoset.setId(childPhotosetElement.getAttribute("id")); photoset.setTitle(childPhotosetElement.getAttribute("title")); photoset.setDescription(childPhotosetElement.getAttribute("description")); return photoset; }
/** * 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); }