com.aetrion.flickr.photos.geo
Class GeoInterface

java.lang.Object
  extended by com.aetrion.flickr.photos.geo.GeoInterface

public class GeoInterface
extends java.lang.Object

Access to the flickr.photos.geo methods.

Author:
till (Till Krech - flickr:extranoise)

Field Summary
static java.lang.String METHOD_GET_LOCATION
           
static java.lang.String METHOD_GET_PERMS
           
static java.lang.String METHOD_REMOVE_LOCATION
           
static java.lang.String METHOD_SET_LOCATION
           
static java.lang.String METHOD_SET_PERMS
           
 
Constructor Summary
GeoInterface(java.lang.String apiKey, Transport transport)
           
 
Method Summary
 GeoData getLocation(java.lang.String photoId)
          Get the geo data (latitude and longitude and the accuracy level) for a photo.
 GeoPermissions getPerms(java.lang.String photoId)
          Get permissions for who may view geo data for a photo.
 void removeLocation(java.lang.String photoId)
          Removes the geo data associated with a photo.
 void setLocation(java.lang.String photoId, GeoData location)
          Sets the geo data (latitude and longitude and, optionally, the accuracy level) for a photo.
 void setPerms(java.lang.String photoId, GeoPermissions perms)
          Set the permission for who may view the geo data associated with a photo.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

METHOD_GET_LOCATION

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

METHOD_GET_PERMS

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

METHOD_REMOVE_LOCATION

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

METHOD_SET_LOCATION

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

METHOD_SET_PERMS

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

GeoInterface

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

getLocation

public GeoData getLocation(java.lang.String photoId)
                    throws java.io.IOException,
                           org.xml.sax.SAXException,
                           FlickrException
Get the geo data (latitude and longitude and the accuracy level) for a photo. This method does not require authentication.

Parameters:
photoId - reqired photo id, not null
Returns:
Geo Data, if the photo has it.
Throws:
org.xml.sax.SAXException
java.io.IOException
FlickrException - if photo id is invalid, if photo has no geodata or if any other error has been reported in the response.

getPerms

public GeoPermissions getPerms(java.lang.String photoId)
                        throws java.io.IOException,
                               org.xml.sax.SAXException,
                               FlickrException
Get permissions for who may view geo data for a photo. This method requires authentication with 'read' permission.

Parameters:
photoId - reqired photo id, not null
Returns:
the permissions
Throws:
org.xml.sax.SAXException
java.io.IOException
org.xml.sax.SAXException
java.io.IOException
FlickrException
FlickrException - if photo id is invalid, if photo has no geodata or if any other error has been reported in the response.

removeLocation

public void removeLocation(java.lang.String photoId)
                    throws java.io.IOException,
                           org.xml.sax.SAXException,
                           FlickrException
Removes the geo data associated with a photo. This method requires authentication with 'write' permission.

Throws:
org.xml.sax.SAXException
java.io.IOException
FlickrException

setLocation

public void setLocation(java.lang.String photoId,
                        GeoData location)
                 throws java.io.IOException,
                        org.xml.sax.SAXException,
                        FlickrException
Sets the geo data (latitude and longitude and, optionally, the accuracy level) for a photo. Before users may assign location data to a photo they must define who, by default, may view that information. Users can edit this preference at http://www.flickr.com/account/geo/privacy/. If a user has not set this preference, the API method will return an error. This method requires authentication with 'write' permission.

Parameters:
photoId - The id of the photo to cet permissions for.
location - geo data with optional accuracy (1-16), accuracy 0 to use the default.
Throws:
org.xml.sax.SAXException
java.io.IOException
FlickrException

setPerms

public void setPerms(java.lang.String photoId,
                     GeoPermissions perms)
              throws java.io.IOException,
                     org.xml.sax.SAXException,
                     FlickrException
Set the permission for who may view the geo data associated with a photo. This method requires authentication with 'write' permission.

Parameters:
photoId - The id of the photo to set permissions for.
perms - Permissions, who can see the geo data of this photo
Throws:
org.xml.sax.SAXException
java.io.IOException
FlickrException


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