org.springframework.social.facebook.api
Interface MediaOperations


public interface MediaOperations

Defines operations for working with albums, photos, and videos.


Method Summary
 java.lang.String createAlbum(java.lang.String name, java.lang.String description)
          Creates a new photo album.
 Album getAlbum(java.lang.String albumId)
          Retrieves data for a specific album.
 byte[] getAlbumImage(java.lang.String albumId)
          Retrieves an album's image as an array of bytes.
 byte[] getAlbumImage(java.lang.String albumId, ImageType imageType)
          Retrieves an album's image as an array of bytes.
 java.util.List<Album> getAlbums()
          Retrieves a list of albums belonging to the authenticated user.
 java.util.List<Album> getAlbums(java.lang.String ownerId)
          Retrieves a list of albums belonging to a specific owner (user, page, etc).
 Photo getPhoto(java.lang.String photoId)
          Retrieve data for a specified photo.
 byte[] getPhotoImage(java.lang.String photoId)
          Retrieves a photo's image as an array of bytes.
 byte[] getPhotoImage(java.lang.String photoId, ImageType imageType)
          Retrieves a photo's image as an array of bytes.
 java.util.List<Photo> getPhotos(java.lang.String albumId)
          Retrieves photo data from a specific album.
 Video getVideo(java.lang.String videoId)
          Retrieves data for a specific video.
 byte[] getVideoImage(java.lang.String videoId)
          Retrieves a video's image as an array of bytes.
 byte[] getVideoImage(java.lang.String videoId, ImageType imageType)
          Retrieves a video's image as an array of bytes.
 java.util.List<Video> getVideos()
          Retrieves a list of videos for the authenticated user.
 java.util.List<Video> getVideos(java.lang.String ownerId)
          Retrieves a list of videos for a specified owner.
 

Method Detail

getAlbums

java.util.List<Album> getAlbums()
Retrieves a list of albums belonging to the authenticated user. Requires "user_photos" or "friends_photos" permission.

Returns:
a list Albums for the user, or an empty list if not available.

getAlbums

java.util.List<Album> getAlbums(java.lang.String ownerId)
Retrieves a list of albums belonging to a specific owner (user, page, etc). Requires "user_photos" or "friends_photos" permission.

Parameters:
ownerId - the album owner's ID
Returns:
a list Albums for the user, or an empty list if not available.

getAlbum

Album getAlbum(java.lang.String albumId)
Retrieves data for a specific album.

Parameters:
albumId - the album ID
Returns:
the requested Album object.

createAlbum

java.lang.String createAlbum(java.lang.String name,
                             java.lang.String description)
Creates a new photo album.

Parameters:
name - the name of the album.
description - the album's description.
Returns:
the ID of the newly created album.

getAlbumImage

byte[] getAlbumImage(java.lang.String albumId)
Retrieves an album's image as an array of bytes. Returns the image in Facebook's "normal" type.

Parameters:
albumId - the album ID
Returns:
an array of bytes containing the album's image.

getAlbumImage

byte[] getAlbumImage(java.lang.String albumId,
                     ImageType imageType)
Retrieves an album's image as an array of bytes.

Parameters:
albumId - the album ID
imageType - the image type (eg., small, normal, large. square)
Returns:
an array of bytes containing the album's image.

getPhotos

java.util.List<Photo> getPhotos(java.lang.String albumId)
Retrieves photo data from a specific album.

Parameters:
albumId - the album's ID
Returns:
a list of Photos in the specified album.

getPhoto

Photo getPhoto(java.lang.String photoId)
Retrieve data for a specified photo.

Parameters:
photoId - the photo's ID
Returns:
the requested Photo

getPhotoImage

byte[] getPhotoImage(java.lang.String photoId)
Retrieves a photo's image as an array of bytes. Returns the image in Facebook's "normal" type.

Parameters:
photoId - the photo ID
Returns:
an array of bytes containing the photo's image.

getPhotoImage

byte[] getPhotoImage(java.lang.String photoId,
                     ImageType imageType)
Retrieves a photo's image as an array of bytes.

Parameters:
photoId - the photo ID
imageType - the image type (eg., small, normal, large. square)
Returns:
an array of bytes containing the photo's image.

getVideos

java.util.List<Video> getVideos()
Retrieves a list of videos for the authenticated user.

Returns:
a list of Video belonging to the authenticated user.

getVideos

java.util.List<Video> getVideos(java.lang.String ownerId)
Retrieves a list of videos for a specified owner.

Parameters:
ownerId - the owner of the videos (could be a user, group, etc)
Returns:
a list of Video belonging to the specified owner.

getVideo

Video getVideo(java.lang.String videoId)
Retrieves data for a specific video.

Parameters:
videoId - the ID of the video.
Returns:
the requested Video data.

getVideoImage

byte[] getVideoImage(java.lang.String videoId)
Retrieves a video's image as an array of bytes. Returns the image in Facebook's "normal" type.

Parameters:
videoId - the video ID
Returns:
an array of bytes containing the video's image.

getVideoImage

byte[] getVideoImage(java.lang.String videoId,
                     ImageType imageType)
Retrieves a video's image as an array of bytes.

Parameters:
videoId - the video ID
imageType - the image type (eg., small, normal, large. square)
Returns:
an array of bytes containing the video's image.