com.aetrion.flickr
Class REST

java.lang.Object
  extended by com.aetrion.flickr.Transport
      extended by com.aetrion.flickr.REST

public class REST
extends Transport

Transport implementation using the REST interface.

Version:
$Id: REST.java,v 1.26 2009/07/01 22:07:08 x-mago Exp $
Author:
Anthony Eden

Field Summary
static java.lang.String PATH
           
 
Fields inherited from class com.aetrion.flickr.Transport
responseClass, REST, SOAP
 
Constructor Summary
REST()
          Construct a new REST transport instance.
REST(java.lang.String host)
          Construct a new REST transport instance using the specified host endpoint.
REST(java.lang.String host, int port)
          Construct a new REST transport instance using the specified host and port endpoint.
 
Method Summary
 Response get(java.lang.String path, java.util.List parameters)
          Invoke an HTTP GET request on a remote host.
 java.lang.String getProxyCredentials()
          Generates Base64-encoded credentials from locally stored username and password.
 boolean isProxyAuth()
           
 Response post(java.lang.String path, java.util.List parameters, boolean multipart)
          Invoke an HTTP POST request on a remote host.
 void setProxy(java.lang.String proxyHost, int proxyPort)
          Set a proxy for REST-requests.
 void setProxy(java.lang.String proxyHost, int proxyPort, java.lang.String username, java.lang.String password)
          Set a proxy with authentication for REST-requests.
 
Methods inherited from class com.aetrion.flickr.Transport
getHost, getPath, getPort, getResponseClass, getTransportType, post, setHost, setPath, setPort, setResponseClass, setTransportType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PATH

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

REST

public REST()
     throws javax.xml.parsers.ParserConfigurationException
Construct a new REST transport instance.

Throws:
javax.xml.parsers.ParserConfigurationException

REST

public REST(java.lang.String host)
     throws javax.xml.parsers.ParserConfigurationException
Construct a new REST transport instance using the specified host endpoint.

Parameters:
host - The host endpoint
Throws:
javax.xml.parsers.ParserConfigurationException

REST

public REST(java.lang.String host,
            int port)
     throws javax.xml.parsers.ParserConfigurationException
Construct a new REST transport instance using the specified host and port endpoint.

Parameters:
host - The host endpoint
port - The port
Throws:
javax.xml.parsers.ParserConfigurationException
Method Detail

setProxy

public void setProxy(java.lang.String proxyHost,
                     int proxyPort)
Set a proxy for REST-requests.

Parameters:
proxyHost -
proxyPort -

setProxy

public void setProxy(java.lang.String proxyHost,
                     int proxyPort,
                     java.lang.String username,
                     java.lang.String password)
Set a proxy with authentication for REST-requests.

Parameters:
proxyHost -
proxyPort -
username -
password -

get

public Response get(java.lang.String path,
                    java.util.List parameters)
             throws java.io.IOException,
                    org.xml.sax.SAXException
Invoke an HTTP GET request on a remote host. You must close the InputStream after you are done with.

Specified by:
get in class Transport
Parameters:
path - The request path
parameters - The parameters (collection of Parameter objects)
Returns:
The Response
Throws:
java.io.IOException
org.xml.sax.SAXException

post

public Response post(java.lang.String path,
                     java.util.List parameters,
                     boolean multipart)
              throws java.io.IOException,
                     org.xml.sax.SAXException
Invoke an HTTP POST request on a remote host.

Specified by:
post in class Transport
Parameters:
path - The request path
parameters - The parameters (collection of Parameter objects)
multipart - Use multipart
Returns:
The Response object
Throws:
java.io.IOException
org.xml.sax.SAXException

isProxyAuth

public boolean isProxyAuth()

getProxyCredentials

public java.lang.String getProxyCredentials()
Generates Base64-encoded credentials from locally stored username and password.

Returns:
credentials


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