com.aetrion.flickr.photos
Class PhotosInterface

java.lang.Object
  extended by com.aetrion.flickr.photos.PhotosInterface

public class PhotosInterface
extends java.lang.Object

Interface for working with Flickr Photos.

Version:
$Id: PhotosInterface.java,v 1.49 2009/07/12 22:43:07 x-mago Exp $
Author:
Anthony Eden

Field Summary
static java.lang.String METHOD_ADD_TAGS
           
static java.lang.String METHOD_DELETE
           
static java.lang.String METHOD_GET_ALL_CONTEXTS
           
static java.lang.String METHOD_GET_CONTACTS_PHOTOS
           
static java.lang.String METHOD_GET_CONTACTS_PUBLIC_PHOTOS
           
static java.lang.String METHOD_GET_CONTEXT
           
static java.lang.String METHOD_GET_COUNTS
           
static java.lang.String METHOD_GET_EXIF
           
static java.lang.String METHOD_GET_FAVORITES
           
static java.lang.String METHOD_GET_INFO
           
static java.lang.String METHOD_GET_INTERESTINGNESS
           
static java.lang.String METHOD_GET_NOT_IN_SET
           
static java.lang.String METHOD_GET_PERMS
           
static java.lang.String METHOD_GET_RECENT
           
static java.lang.String METHOD_GET_SIZES
           
static java.lang.String METHOD_GET_UNTAGGED
           
static java.lang.String METHOD_GET_WITH_GEO_DATA
           
static java.lang.String METHOD_GET_WITHOUT_GEO_DATA
           
static java.lang.String METHOD_RECENTLY_UPDATED
           
static java.lang.String METHOD_REMOVE_TAG
           
static java.lang.String METHOD_SEARCH
           
static java.lang.String METHOD_SET_CONTENTTYPE
           
static java.lang.String METHOD_SET_DATES
           
static java.lang.String METHOD_SET_META
           
static java.lang.String METHOD_SET_PERMS
           
static java.lang.String METHOD_SET_SAFETYLEVEL
           
static java.lang.String METHOD_SET_TAGS
           
 
Constructor Summary
PhotosInterface(java.lang.String apiKey, java.lang.String sharedSecret, Transport transport)
           
 
Method Summary
 void addTags(java.lang.String photoId, java.lang.String[] tags)
          Add tags to a photo.
 void delete(java.lang.String photoId)
          Delete a photo from flickr.
 java.util.List getAllContexts(java.lang.String photoId)
          Returns all visble sets and pools the photo belongs to.
 PhotoList getContactsPhotos(int count, boolean justFriends, boolean singlePhoto, boolean includeSelf)
          Get photos from the user's contacts.
 PhotoList getContactsPublicPhotos(java.lang.String userId, int count, boolean justFriends, boolean singlePhoto, boolean includeSelf)
          Get public photos from the user's contacts.
 PhotoList getContactsPublicPhotos(java.lang.String userId, java.util.Set extras, int count, boolean justFriends, boolean singlePhoto, boolean includeSelf)
           
 PhotoContext getContext(java.lang.String photoId)
          Get the context for the specified photo.
 java.util.Collection getCounts(java.util.Date[] dates, java.util.Date[] takenDates)
          Gets a collection of photo counts for the given date ranges for the calling user.
 java.util.Collection getExif(java.lang.String photoId, java.lang.String secret)
          Get the Exif data for the photo.
 java.util.Collection getFavorites(java.lang.String photoId, int perPage, int page)
          Returns the list of people who have favorited a given photo.
 GeoInterface getGeoInterface()
          Get the geo interface.
 java.awt.image.BufferedImage getImage(Photo photo, int size)
          Request an image from the Flickr-servers.
 java.awt.image.BufferedImage getImage(java.lang.String urlStr)
          Download of an image by URL.
 java.io.InputStream getImageAsStream(Photo photo, int size)
          Request an image from the Flickr-servers.
 Photo getInfo(java.lang.String photoId, java.lang.String secret)
          Get all info for the specified photo.
 PhotoList getNotInSet(int perPage, int page)
          Return a collection of Photo objects not in part of any sets.
 Permissions getPerms(java.lang.String photoId)
          Get the permission information for the specified photo.
 Photo getPhoto(java.lang.String id)
          Get the photo for the specified ID.
 Photo getPhoto(java.lang.String id, java.lang.String secret)
          Get the photo for the specified ID with the given secret.
 PhotoList getRecent(int perPage, int page)
          Get a collection of recent photos.
 java.util.Collection getSizes(java.lang.String photoId)
          Get the available sizes of a Photo.
 PhotoList getUntagged(int perPage, int page)
          Get the collection of untagged photos.
 PhotoList getWithGeoData(java.util.Date minUploadDate, java.util.Date maxUploadDate, java.util.Date minTakenDate, java.util.Date maxTakenDate, int privacyFilter, java.lang.String sort, java.util.Set extras, int perPage, int page)
          Returns a list of your geo-tagged photos.
 PhotoList getWithoutGeoData(java.util.Date minUploadDate, java.util.Date maxUploadDate, java.util.Date minTakenDate, java.util.Date maxTakenDate, int privacyFilter, java.lang.String sort, java.util.Set extras, int perPage, int page)
          Returns a list of your photos which haven't been geo-tagged.
 PhotoList recentlyUpdated(java.util.Date minDate, java.util.Set extras, int perPage, int page)
          Return a list of your photos that have been recently created or which have been recently modified.
 void removeTag(java.lang.String tagId)
          Remove a tag from a photo.
 PhotoList search(SearchParameters params, int perPage, int page)
          Search for photos which match the given search parameters.
 PhotoList searchInterestingness(SearchParameters params, int perPage, int page)
          Search for interesting photos using the Flickr Interestingness algorithm.
 void setContentType(java.lang.String photoId, java.lang.String contentType)
          Set the content type of a photo.
 void setDates(java.lang.String photoId, java.util.Date datePosted, java.util.Date dateTaken, java.lang.String dateTakenGranularity)
          Set the dates for the specified photo.
 void setMeta(java.lang.String photoId, java.lang.String title, java.lang.String description)
          Set the meta data for the photo.
 void setPerms(java.lang.String photoId, Permissions permissions)
          Set the permissions for the photo.
 void setSafetyLevel(java.lang.String photoId, java.lang.String safetyLevel, java.lang.Boolean hidden)
          Set the safety level (adultness) of a photo.
 void setTags(java.lang.String photoId, java.lang.String[] tags)
          Set the tags for a photo.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METHOD_ADD_TAGS

public static final java.lang.String METHOD_ADD_TAGS
See Also:
Constant Field Values

METHOD_DELETE

public static final java.lang.String METHOD_DELETE
See Also:
Constant Field Values

METHOD_GET_ALL_CONTEXTS

public static final java.lang.String METHOD_GET_ALL_CONTEXTS
See Also:
Constant Field Values

METHOD_GET_CONTACTS_PHOTOS

public static final java.lang.String METHOD_GET_CONTACTS_PHOTOS
See Also:
Constant Field Values

METHOD_GET_CONTACTS_PUBLIC_PHOTOS

public static final java.lang.String METHOD_GET_CONTACTS_PUBLIC_PHOTOS
See Also:
Constant Field Values

METHOD_GET_CONTEXT

public static final java.lang.String METHOD_GET_CONTEXT
See Also:
Constant Field Values

METHOD_GET_COUNTS

public static final java.lang.String METHOD_GET_COUNTS
See Also:
Constant Field Values

METHOD_GET_EXIF

public static final java.lang.String METHOD_GET_EXIF
See Also:
Constant Field Values

METHOD_GET_FAVORITES

public static final java.lang.String METHOD_GET_FAVORITES
See Also:
Constant Field Values

METHOD_GET_INFO

public static final java.lang.String METHOD_GET_INFO
See Also:
Constant Field Values

METHOD_GET_NOT_IN_SET

public static final java.lang.String METHOD_GET_NOT_IN_SET
See Also:
Constant Field Values

METHOD_GET_PERMS

public static final java.lang.String METHOD_GET_PERMS
See Also:
Constant Field Values

METHOD_GET_RECENT

public static final java.lang.String METHOD_GET_RECENT
See Also:
Constant Field Values

METHOD_GET_SIZES

public static final java.lang.String METHOD_GET_SIZES
See Also:
Constant Field Values

METHOD_GET_UNTAGGED

public static final java.lang.String METHOD_GET_UNTAGGED
See Also:
Constant Field Values

METHOD_GET_WITH_GEO_DATA

public static final java.lang.String METHOD_GET_WITH_GEO_DATA
See Also:
Constant Field Values

METHOD_GET_WITHOUT_GEO_DATA

public static final java.lang.String METHOD_GET_WITHOUT_GEO_DATA
See Also:
Constant Field Values

METHOD_RECENTLY_UPDATED

public static final java.lang.String METHOD_RECENTLY_UPDATED
See Also:
Constant Field Values

METHOD_REMOVE_TAG

public static final java.lang.String METHOD_REMOVE_TAG
See Also:
Constant Field Values

METHOD_SEARCH

public static final java.lang.String METHOD_SEARCH
See Also:
Constant Field Values

METHOD_SET_CONTENTTYPE

public static final java.lang.String METHOD_SET_CONTENTTYPE
See Also:
Constant Field Values

METHOD_SET_DATES

public static final java.lang.String METHOD_SET_DATES
See Also:
Constant Field Values

METHOD_SET_META

public static final java.lang.String METHOD_SET_META
See Also:
Constant Field Values

METHOD_SET_PERMS

public static final java.lang.String METHOD_SET_PERMS
See Also:
Constant Field Values

METHOD_SET_SAFETYLEVEL

public static final java.lang.String METHOD_SET_SAFETYLEVEL
See Also:
Constant Field Values

METHOD_SET_TAGS

public static final java.lang.String METHOD_SET_TAGS
See Also:
Constant Field Values

METHOD_GET_INTERESTINGNESS

public static final java.lang.String METHOD_GET_INTERESTINGNESS
See Also:
Constant Field Values
Constructor Detail

PhotosInterface

public PhotosInterface(java.lang.String apiKey,
                       java.lang.String sharedSecret,
                       Transport transport)
Method Detail

getGeoInterface

public GeoInterface getGeoInterface()
Get the geo interface.

Returns:
Access class to the flickr.photos.geo methods.

addTags

public void addTags(java.lang.String photoId,
                    java.lang.String[] tags)
             throws java.io.IOException,
                    org.xml.sax.SAXException,
                    FlickrException
Add tags to a photo. This method requires authentication with 'write' permission.

Parameters:
photoId - The photo ID
tags - The tags
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

delete

public void delete(java.lang.String photoId)
            throws java.io.IOException,
                   org.xml.sax.SAXException,
                   FlickrException
Delete a photo from flickr. This method requires authentication with 'delete' permission.

Parameters:
photoId -
Throws:
org.xml.sax.SAXException
java.io.IOException
FlickrException

getAllContexts

public java.util.List getAllContexts(java.lang.String photoId)
                              throws java.io.IOException,
                                     org.xml.sax.SAXException,
                                     FlickrException
Returns all visble sets and pools the photo belongs to. This method does not require authentication.

Parameters:
photoId - The photo to return information for.
Returns:
a list of PhotoPlace objects
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getContactsPhotos

public PhotoList getContactsPhotos(int count,
                                   boolean justFriends,
                                   boolean singlePhoto,
                                   boolean includeSelf)
                            throws java.io.IOException,
                                   org.xml.sax.SAXException,
                                   FlickrException
Get photos from the user's contacts. This method requires authentication with 'read' permission.

Parameters:
count - The number of photos to return
justFriends - Set to true to only show friends photos
singlePhoto - Set to true to get a single photo
includeSelf - Set to true to include self
Returns:
The Collection of photos
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getContactsPublicPhotos

public PhotoList getContactsPublicPhotos(java.lang.String userId,
                                         int count,
                                         boolean justFriends,
                                         boolean singlePhoto,
                                         boolean includeSelf)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException,
                                         FlickrException
Get public photos from the user's contacts. This method does not require authentication.

Parameters:
userId - The user ID
count - The number of photos to return
justFriends - True to include friends
singlePhoto - True to get a single photo
includeSelf - True to include self
Returns:
A collection of Photo objects
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException
See Also:
Extras

getContactsPublicPhotos

public PhotoList getContactsPublicPhotos(java.lang.String userId,
                                         java.util.Set extras,
                                         int count,
                                         boolean justFriends,
                                         boolean singlePhoto,
                                         boolean includeSelf)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException,
                                         FlickrException
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getContext

public PhotoContext getContext(java.lang.String photoId)
                        throws java.io.IOException,
                               org.xml.sax.SAXException,
                               FlickrException
Get the context for the specified photo. This method does not require authentication.

Parameters:
photoId - The photo ID
Returns:
The PhotoContext
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getCounts

public java.util.Collection getCounts(java.util.Date[] dates,
                                      java.util.Date[] takenDates)
                               throws java.io.IOException,
                                      org.xml.sax.SAXException,
                                      FlickrException
Gets a collection of photo counts for the given date ranges for the calling user. This method requires authentication with 'read' permission.

Parameters:
dates - An array of dates, denoting the periods to return counts for. They should be specified smallest first.
takenDates - An array of dates, denoting the periods to return counts for. They should be specified smallest first.
Returns:
A Collection of Photocount objects
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getExif

public java.util.Collection getExif(java.lang.String photoId,
                                    java.lang.String secret)
                             throws java.io.IOException,
                                    org.xml.sax.SAXException,
                                    FlickrException
Get the Exif data for the photo. The calling user must have permission to view the photo. This method does not require authentication.

Parameters:
photoId - The photo ID
secret - The secret
Returns:
A collection of Exif objects
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getFavorites

public java.util.Collection getFavorites(java.lang.String photoId,
                                         int perPage,
                                         int page)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException,
                                         FlickrException
Returns the list of people who have favorited a given photo. This method does not require authentication.

Parameters:
photoId -
perPage -
page -
Returns:
List of User
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getInfo

public Photo getInfo(java.lang.String photoId,
                     java.lang.String secret)
              throws java.io.IOException,
                     org.xml.sax.SAXException,
                     FlickrException
Get all info for the specified photo. The calling user must have permission to view the photo. This method does not require authentication.

Parameters:
photoId - The photo Id
secret - The optional secret String
Returns:
The Photo
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getNotInSet

public PhotoList getNotInSet(int perPage,
                             int page)
                      throws java.io.IOException,
                             org.xml.sax.SAXException,
                             FlickrException
Return a collection of Photo objects not in part of any sets. This method requires authentication with 'read' permission.

Parameters:
perPage - The per page
page - The page
Returns:
The collection of Photo objects
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getPerms

public Permissions getPerms(java.lang.String photoId)
                     throws java.io.IOException,
                            org.xml.sax.SAXException,
                            FlickrException
Get the permission information for the specified photo. This method requires authentication with 'read' permission.

Parameters:
photoId - The photo id
Returns:
The Permissions object
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getRecent

public PhotoList getRecent(int perPage,
                           int page)
                    throws java.io.IOException,
                           org.xml.sax.SAXException,
                           FlickrException
Get a collection of recent photos. This method does not require authentication.

Parameters:
perPage - The number of photos per page
page - The page offset
Returns:
A collection of Photo objects
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getSizes

public java.util.Collection getSizes(java.lang.String photoId)
                              throws java.io.IOException,
                                     org.xml.sax.SAXException,
                                     FlickrException
Get the available sizes of a Photo. The calling user must have permission to view the photo. This method does not require authentication.

Parameters:
photoId - The photo ID
Returns:
A collection of Size
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getUntagged

public PhotoList getUntagged(int perPage,
                             int page)
                      throws java.io.IOException,
                             org.xml.sax.SAXException,
                             FlickrException
Get the collection of untagged photos. This method requires authentication with 'read' permission.

Parameters:
perPage -
page -
Returns:
A Collection of Photos
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getWithGeoData

public PhotoList getWithGeoData(java.util.Date minUploadDate,
                                java.util.Date maxUploadDate,
                                java.util.Date minTakenDate,
                                java.util.Date maxTakenDate,
                                int privacyFilter,
                                java.lang.String sort,
                                java.util.Set extras,
                                int perPage,
                                int page)
                         throws FlickrException,
                                java.io.IOException,
                                org.xml.sax.SAXException
Returns a list of your geo-tagged photos. This method requires authentication with 'read' permission.

Parameters:
minUploadDate - Minimum upload date. Photos with an upload date greater than or equal to this value will be returned. Set to null to not specify a date.
maxUploadDate - Maximum upload date. Photos with an upload date less than or equal to this value will be returned. Set to null to not specify a date.
minTakenDate - Minimum taken date. Photos with an taken date greater than or equal to this value will be returned. Set to null to not specify a date.
maxTakenDate - Maximum taken date. Photos with an taken date less than or equal to this value will be returned. Set to null to not specify a date.
privacyFilter - Return photos only matching a certain privacy level. Valid values are:
  • 1 public photos
  • 2 private photos visible to friends
  • 3 private photos visible to family
  • 4 private photos visible to friends & family
  • 5 completely private photos
Set to 0 to not specify a privacy Filter.
sort - The order in which to sort returned photos. Deafults to date-posted-desc. The possible values are: date-posted-asc, date-posted-desc, date-taken-asc, date-taken-desc, interestingness-desc, and interestingness-asc.
extras - A set of Strings controlling the extra information to fetch for each returned record. Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server, original_format, last_update, geo. Set to null or an empty set to not specify any extras.
perPage - Number of photos to return per page. If this argument is 0, it defaults to 100. The maximum allowed value is 500.
page - The page of results to return. If this argument is 0, it defaults to 1.
Returns:
photos
Throws:
FlickrException
java.io.IOException
org.xml.sax.SAXException
See Also:
Extras

getWithoutGeoData

public PhotoList getWithoutGeoData(java.util.Date minUploadDate,
                                   java.util.Date maxUploadDate,
                                   java.util.Date minTakenDate,
                                   java.util.Date maxTakenDate,
                                   int privacyFilter,
                                   java.lang.String sort,
                                   java.util.Set extras,
                                   int perPage,
                                   int page)
                            throws FlickrException,
                                   java.io.IOException,
                                   org.xml.sax.SAXException
Returns a list of your photos which haven't been geo-tagged. This method requires authentication with 'read' permission.

Parameters:
minUploadDate - Minimum upload date. Photos with an upload date greater than or equal to this value will be returned. Set to null to not specify a date.
maxUploadDate - Maximum upload date. Photos with an upload date less than or equal to this value will be returned. Set to null to not specify a date.
minTakenDate - Minimum taken date. Photos with an taken date greater than or equal to this value will be returned. Set to null to not specify a date.
maxTakenDate - Maximum taken date. Photos with an taken date less than or equal to this value will be returned. Set to null to not specify a date.
privacyFilter - Return photos only matching a certain privacy level. Valid values are:
  • 1 public photos
  • 2 private photos visible to friends
  • 3 private photos visible to family
  • 4 private photos visible to friends & family
  • 5 completely private photos
Set to 0 to not specify a privacy Filter.
sort - The order in which to sort returned photos. Deafults to date-posted-desc. The possible values are: date-posted-asc, date-posted-desc, date-taken-asc, date-taken-desc, interestingness-desc, and interestingness-asc.
extras - A set of Strings controlling the extra information to fetch for each returned record. Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server, original_format, last_update, geo. Set to null or an empty set to not specify any extras.
perPage - Number of photos to return per page. If this argument is 0, it defaults to 100. The maximum allowed value is 500.
page - The page of results to return. If this argument is 0, it defaults to 1.
Returns:
a photo list
Throws:
FlickrException
java.io.IOException
org.xml.sax.SAXException
See Also:
Extras

recentlyUpdated

public PhotoList recentlyUpdated(java.util.Date minDate,
                                 java.util.Set extras,
                                 int perPage,
                                 int page)
                          throws java.io.IOException,
                                 org.xml.sax.SAXException,
                                 FlickrException
Return a list of your photos that have been recently created or which have been recently modified. Recently modified may mean that the photo's metadata (title, description, tags) may have been changed or a comment has been added (or just modified somehow :-) This method requires authentication with 'read' permission.

Parameters:
minDate - Date indicating the date from which modifications should be compared. Must be given.
extras - A set of Strings controlling the extra information to fetch for each returned record. Currently supported fields are: license, date_upload, date_taken, owner_name, icon_server, original_format, last_update, geo. Set to null or an empty set to not specify any extras.
perPage - Number of photos to return per page. If this argument is 0, it defaults to 100. The maximum allowed value is 500.
page - The page of results to return. If this argument is 0, it defaults to 1.
Returns:
a list of photos
Throws:
org.xml.sax.SAXException
java.io.IOException
FlickrException
See Also:
Extras

removeTag

public void removeTag(java.lang.String tagId)
               throws java.io.IOException,
                      org.xml.sax.SAXException,
                      FlickrException
Remove a tag from a photo. This method requires authentication with 'write' permission.

Parameters:
tagId - The tag ID
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

search

public PhotoList search(SearchParameters params,
                        int perPage,
                        int page)
                 throws java.io.IOException,
                        org.xml.sax.SAXException,
                        FlickrException
Search for photos which match the given search parameters. This method does not require authentication.

Parameters:
params - The search parameters
perPage - The number of photos to show per page
page - The page offset
Returns:
A PhotoList
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

searchInterestingness

public PhotoList searchInterestingness(SearchParameters params,
                                       int perPage,
                                       int page)
                                throws java.io.IOException,
                                       org.xml.sax.SAXException,
                                       FlickrException
Search for interesting photos using the Flickr Interestingness algorithm.

Parameters:
params - Any search parameters
perPage - Number of items per page
page - The page to start on
Returns:
A PhotoList
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

setContentType

public void setContentType(java.lang.String photoId,
                           java.lang.String contentType)
                    throws java.io.IOException,
                           org.xml.sax.SAXException,
                           FlickrException
Set the content type of a photo. This method requires authentication with 'write' permission.

Parameters:
photoId - The photo ID
contentType - The contentType to set
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException
See Also:
Flickr.CONTENTTYPE_PHOTO, Flickr.CONTENTTYPE_SCREENSHOT, Flickr.CONTENTTYPE_OTHER

setDates

public void setDates(java.lang.String photoId,
                     java.util.Date datePosted,
                     java.util.Date dateTaken,
                     java.lang.String dateTakenGranularity)
              throws java.io.IOException,
                     org.xml.sax.SAXException,
                     FlickrException
Set the dates for the specified photo. This method requires authentication with 'write' permission.

Parameters:
photoId - The photo ID
datePosted - The date the photo was posted or null
dateTaken - The date the photo was taken or null
dateTakenGranularity - The granularity of the taken date or null
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

setMeta

public void setMeta(java.lang.String photoId,
                    java.lang.String title,
                    java.lang.String description)
             throws java.io.IOException,
                    org.xml.sax.SAXException,
                    FlickrException
Set the meta data for the photo. This method requires authentication with 'write' permission.

Parameters:
photoId - The photo ID
title - The new title
description - The new description
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

setPerms

public void setPerms(java.lang.String photoId,
                     Permissions permissions)
              throws java.io.IOException,
                     org.xml.sax.SAXException,
                     FlickrException
Set the permissions for the photo. This method requires authentication with 'write' permission.

Parameters:
photoId - The photo ID
permissions - The permissions object
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

setSafetyLevel

public void setSafetyLevel(java.lang.String photoId,
                           java.lang.String safetyLevel,
                           java.lang.Boolean hidden)
                    throws java.io.IOException,
                           org.xml.sax.SAXException,
                           FlickrException
Set the safety level (adultness) of a photo.

This method requires authentication with 'write' permission.

Parameters:
photoId - The photo ID
safetyLevel - The safety level of the photo or null
hidden - Hidden from public searches or not or null
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException
See Also:
Flickr.SAFETYLEVEL_SAFE, Flickr.SAFETYLEVEL_MODERATE, Flickr.SAFETYLEVEL_RESTRICTED

setTags

public void setTags(java.lang.String photoId,
                    java.lang.String[] tags)
             throws java.io.IOException,
                    org.xml.sax.SAXException,
                    FlickrException
Set the tags for a photo. This method requires authentication with 'write' permission.

Parameters:
photoId - The photo ID
tags - The tag array
Throws:
java.io.IOException
org.xml.sax.SAXException
FlickrException

getPhoto

public Photo getPhoto(java.lang.String id)
               throws java.io.IOException,
                      FlickrException,
                      org.xml.sax.SAXException
Get the photo for the specified ID. Currently maps to the getInfo() method.

Parameters:
id - The ID
Returns:
The Photo
Throws:
java.io.IOException
FlickrException
org.xml.sax.SAXException

getPhoto

public Photo getPhoto(java.lang.String id,
                      java.lang.String secret)
               throws java.io.IOException,
                      FlickrException,
                      org.xml.sax.SAXException
Get the photo for the specified ID with the given secret. Currently maps to the getInfo() method.

Parameters:
id - The ID
secret - The secret
Returns:
The Photo
Throws:
java.io.IOException
FlickrException
org.xml.sax.SAXException

getImageAsStream

public java.io.InputStream getImageAsStream(Photo photo,
                                            int size)
                                     throws java.io.IOException,
                                            FlickrException
Request an image from the Flickr-servers.
Callers must close the stream upon completion.

At Size you can find constants for the available sizes.

Parameters:
photo - A photo-object
size - The Size
Returns:
InputStream The InputStream
Throws:
java.io.IOException
FlickrException

getImage

public java.awt.image.BufferedImage getImage(Photo photo,
                                             int size)
                                      throws java.io.IOException,
                                             FlickrException
Request an image from the Flickr-servers.

At Size you can find constants for the available sizes.

Parameters:
photo - A photo-object
size - The size
Returns:
An Image
Throws:
java.io.IOException
FlickrException

getImage

public java.awt.image.BufferedImage getImage(java.lang.String urlStr)
                                      throws java.io.IOException
Download of an image by URL.

Parameters:
urlStr - The URL of a Photo
Returns:
BufferedImage The The Image
Throws:
java.io.IOException


Copyright (C) 2005-2008 Aetrion LLC. All Rights Reserved.