public class PhotosInterface
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
PhotosInterface(java.lang.String apiKey,
java.lang.String sharedSecret,
Transport transport) |
| Modifier and Type | Method and Description |
|---|---|
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<PhotoPlace> |
getAllContexts(java.lang.String photoId)
Returns all visble sets and pools the photo belongs to.
|
PhotoList<Photo> |
getContactsPhotos(int count,
boolean justFriends,
boolean singlePhoto,
boolean includeSelf)
Get photos from the user's contacts.
|
PhotoList<Photo> |
getContactsPublicPhotos(java.lang.String userId,
int count,
boolean justFriends,
boolean singlePhoto,
boolean includeSelf)
Get public photos from the user's contacts.
|
PhotoList<Photo> |
getContactsPublicPhotos(java.lang.String userId,
java.util.Set<java.lang.String> 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<Photocount> |
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<Exif> |
getExif(java.lang.String photoId,
java.lang.String secret)
Get the Exif data for the photo.
|
java.util.Collection<User> |
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.
Callers must close the stream upon completion. |
Photo |
getInfo(java.lang.String photoId,
java.lang.String secret)
Get all info for the specified photo.
|
PhotoList<Photo> |
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<Photo> |
getRecent(java.util.Set<java.lang.String> extras,
int perPage,
int page)
Get a collection of recent photos.
|
java.util.Collection<Size> |
getSizes(java.lang.String photoId)
Get the available sizes of a Photo.
|
java.util.Collection<Size> |
getSizes(java.lang.String photoId,
boolean sign)
Get the available sizes of a Photo.
|
PhotoList<Photo> |
getUntagged(int perPage,
int page)
Get the collection of untagged photos.
|
PhotoList<Photo> |
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<java.lang.String> extras,
int perPage,
int page)
Returns a list of your geo-tagged photos.
|
PhotoList<Photo> |
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<java.lang.String> extras,
int perPage,
int page)
Returns a list of your photos which haven't been geo-tagged.
|
PhotoList<Photo> |
recentlyUpdated(java.util.Date minDate,
java.util.Set<java.lang.String> 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<Photo> |
search(SearchParameters params,
int perPage,
int page)
Search for photos which match the given search parameters.
|
PhotoList<Photo> |
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.
|
public static final java.lang.String METHOD_ADD_TAGS
public static final java.lang.String METHOD_DELETE
public static final java.lang.String METHOD_GET_ALL_CONTEXTS
public static final java.lang.String METHOD_GET_CONTACTS_PHOTOS
public static final java.lang.String METHOD_GET_CONTACTS_PUBLIC_PHOTOS
public static final java.lang.String METHOD_GET_CONTEXT
public static final java.lang.String METHOD_GET_COUNTS
public static final java.lang.String METHOD_GET_EXIF
public static final java.lang.String METHOD_GET_FAVORITES
public static final java.lang.String METHOD_GET_INFO
public static final java.lang.String METHOD_GET_NOT_IN_SET
public static final java.lang.String METHOD_GET_PERMS
public static final java.lang.String METHOD_GET_RECENT
public static final java.lang.String METHOD_GET_SIZES
public static final java.lang.String METHOD_GET_UNTAGGED
public static final java.lang.String METHOD_GET_WITH_GEO_DATA
public static final java.lang.String METHOD_GET_WITHOUT_GEO_DATA
public static final java.lang.String METHOD_RECENTLY_UPDATED
public static final java.lang.String METHOD_REMOVE_TAG
public static final java.lang.String METHOD_SEARCH
public static final java.lang.String METHOD_SET_CONTENTTYPE
public static final java.lang.String METHOD_SET_DATES
public static final java.lang.String METHOD_SET_META
public static final java.lang.String METHOD_SET_PERMS
public static final java.lang.String METHOD_SET_SAFETYLEVEL
public static final java.lang.String METHOD_SET_TAGS
public static final java.lang.String METHOD_GET_INTERESTINGNESS
public PhotosInterface(java.lang.String apiKey,
java.lang.String sharedSecret,
Transport transport)
public GeoInterface getGeoInterface()
public void addTags(java.lang.String photoId,
java.lang.String[] tags)
throws FlickrException
photoId - The photo IDtags - The tagsFlickrExceptionpublic void delete(java.lang.String photoId)
throws FlickrException
photoId - FlickrExceptionpublic java.util.List<PhotoPlace> getAllContexts(java.lang.String photoId) throws FlickrException
photoId - The photo to return information for.PhotoPlace objectsFlickrExceptionpublic PhotoList<Photo> getContactsPhotos(int count, boolean justFriends, boolean singlePhoto, boolean includeSelf) throws FlickrException
count - The number of photos to returnjustFriends - Set to true to only show friends photossinglePhoto - Set to true to get a single photoincludeSelf - Set to true to include selfFlickrExceptionpublic PhotoList<Photo> getContactsPublicPhotos(java.lang.String userId, int count, boolean justFriends, boolean singlePhoto, boolean includeSelf) throws FlickrException
userId - The user IDcount - The number of photos to returnjustFriends - True to include friendssinglePhoto - True to get a single photoincludeSelf - True to include selfFlickrExceptionExtraspublic PhotoList<Photo> getContactsPublicPhotos(java.lang.String userId, java.util.Set<java.lang.String> extras, int count, boolean justFriends, boolean singlePhoto, boolean includeSelf) throws FlickrException
FlickrExceptionpublic PhotoContext getContext(java.lang.String photoId) throws FlickrException
photoId - The photo IDFlickrExceptionpublic java.util.Collection<Photocount> getCounts(java.util.Date[] dates, java.util.Date[] takenDates) throws FlickrException
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.FlickrExceptionpublic java.util.Collection<Exif> getExif(java.lang.String photoId, java.lang.String secret) throws FlickrException
photoId - The photo IDsecret - The secretFlickrExceptionpublic java.util.Collection<User> getFavorites(java.lang.String photoId, int perPage, int page) throws FlickrException
photoId - perPage - page - UserFlickrExceptionpublic Photo getInfo(java.lang.String photoId, java.lang.String secret) throws FlickrException
photoId - The photo Idsecret - The optional secret StringFlickrExceptionpublic PhotoList<Photo> getNotInSet(int perPage, int page) throws FlickrException
perPage - The per pagepage - The pageFlickrExceptionpublic Permissions getPerms(java.lang.String photoId) throws FlickrException
photoId - The photo idFlickrExceptionpublic PhotoList<Photo> getRecent(java.util.Set<java.lang.String> extras, int perPage, int page) throws FlickrException
extras - Set of extra-fieldsperPage - The number of photos per pagepage - The page offsetFlickrExceptionExtraspublic java.util.Collection<Size> getSizes(java.lang.String photoId) throws FlickrException
photoId - The photo IDSizeFlickrExceptionpublic java.util.Collection<Size> getSizes(java.lang.String photoId, boolean sign) throws FlickrException
photoId - The photo IDsign - toggle to allow optionally signing the call (Authenticate)SizeFlickrExceptionpublic PhotoList<Photo> getUntagged(int perPage, int page) throws FlickrException
perPage - page - FlickrExceptionpublic PhotoList<Photo> 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<java.lang.String> extras, int perPage, int page) throws FlickrException
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:
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.FlickrExceptionExtraspublic PhotoList<Photo> 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<java.lang.String> extras, int perPage, int page) throws FlickrException
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:
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.FlickrExceptionExtraspublic PhotoList<Photo> recentlyUpdated(java.util.Date minDate, java.util.Set<java.lang.String> extras, int perPage, int page) throws FlickrException
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.FlickrExceptionExtraspublic void removeTag(java.lang.String tagId)
throws FlickrException
tagId - The tag IDFlickrExceptionpublic PhotoList<Photo> search(SearchParameters params, int perPage, int page) throws FlickrException
params - The search parametersperPage - The number of photos to show per pagepage - The page offsetFlickrExceptionpublic PhotoList<Photo> searchInterestingness(SearchParameters params, int perPage, int page) throws FlickrException
params - Any search parametersperPage - Number of items per pagepage - The page to start onFlickrExceptionpublic void setContentType(java.lang.String photoId,
java.lang.String contentType)
throws FlickrException
photoId - The photo IDcontentType - The contentType to setFlickrExceptionFlickr.CONTENTTYPE_PHOTO,
Flickr.CONTENTTYPE_SCREENSHOT,
Flickr.CONTENTTYPE_OTHERpublic void setDates(java.lang.String photoId,
java.util.Date datePosted,
java.util.Date dateTaken,
java.lang.String dateTakenGranularity)
throws FlickrException
photoId - The photo IDdatePosted - The date the photo was posted or nulldateTaken - The date the photo was taken or nulldateTakenGranularity - The granularity of the taken date or nullFlickrExceptionpublic void setMeta(java.lang.String photoId,
java.lang.String title,
java.lang.String description)
throws FlickrException
photoId - The photo IDtitle - The new titledescription - The new descriptionFlickrExceptionpublic void setPerms(java.lang.String photoId,
Permissions permissions)
throws FlickrException
photoId - The photo IDpermissions - The permissions objectFlickrExceptionpublic void setSafetyLevel(java.lang.String photoId,
java.lang.String safetyLevel,
java.lang.Boolean hidden)
throws FlickrException
This method requires authentication with 'write' permission.
photoId - The photo IDsafetyLevel - The safety level of the photo or nullhidden - Hidden from public searches or not or nullFlickrExceptionFlickr.SAFETYLEVEL_SAFE,
Flickr.SAFETYLEVEL_MODERATE,
Flickr.SAFETYLEVEL_RESTRICTEDpublic void setTags(java.lang.String photoId,
java.lang.String[] tags)
throws FlickrException
photoId - The photo IDtags - The tag arrayFlickrExceptionpublic Photo getPhoto(java.lang.String id) throws FlickrException
id - The IDorg.xml.sax.SAXExceptionFlickrExceptionpublic Photo getPhoto(java.lang.String id, java.lang.String secret) throws FlickrException
id - The IDsecret - The secretorg.xml.sax.SAXExceptionFlickrExceptionpublic java.io.InputStream getImageAsStream(Photo photo, int size) throws FlickrException
At Size you can find constants for the available sizes.
photo - A photo-objectsize - The SizeFlickrExceptionpublic java.awt.image.BufferedImage getImage(Photo photo, int size) throws FlickrException
At Size you can find constants for the available sizes.
photo - A photo-objectsize - The sizeFlickrExceptionpublic java.awt.image.BufferedImage getImage(java.lang.String urlStr)
throws FlickrException
urlStr - The URL of a PhotoFlickrException