com.buglabs.util.simplerestclient
Class BasicAuthenticationConnectionProvider

java.lang.Object
  extended by com.buglabs.util.simplerestclient.DefaultConnectionProvider
      extended by com.buglabs.util.simplerestclient.BasicAuthenticationConnectionProvider
All Implemented Interfaces:
IConnectionProvider

public class BasicAuthenticationConnectionProvider
extends DefaultConnectionProvider

A connection provider to use HTTP Basic Authentication Create this and pass it into the HTTPRequest construction when creating it to use basic authenticatioin: HettpRequest req = HTTPRequest(new BasicAuthenticationConnectionProvider("foo", "bar"));


Constructor Summary
BasicAuthenticationConnectionProvider(java.lang.String username, java.lang.String password)
           
 
Method Summary
 java.net.HttpURLConnection getConnection(java.lang.String urlStr)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicAuthenticationConnectionProvider

public BasicAuthenticationConnectionProvider(java.lang.String username,
                                             java.lang.String password)
Method Detail

getConnection

public java.net.HttpURLConnection getConnection(java.lang.String urlStr)
                                         throws java.io.IOException
Specified by:
getConnection in interface IConnectionProvider
Overrides:
getConnection in class DefaultConnectionProvider
Throws:
java.io.IOException