|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.ferris.net.BasicAuthenticationUrlConnection
public class BasicAuthenticationUrlConnection
Opens a URLConnection and uses the given credentials to pass a username and password along for doing HTTP basic authentication.
Constructor Summary | |
---|---|
BasicAuthenticationUrlConnection(URL url,
String username,
String clearTextPassword)
Establishes a connection which can be read from the InputStream from this object. |
Method Summary | |
---|---|
void |
close()
Sets all properties to null and closes the InputStream |
InputStream |
getInputStream()
Get the InputStream
from the URLConnection . |
URLConnection |
getUrlConnection()
Get the URLConnection object
created by this class's constructor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BasicAuthenticationUrlConnection(URL url, String username, String clearTextPassword) throws IOException
InputStream
from this object.
The username and password are Base64 encoded before
sending them out so don't worry about a clear text
password being sent over the network. Make sure
you call close()
when you're done.
url
- - The URL.username
- - The basic authentication usernameclearTextPassword
- - The basic authentication
clear text password. This (along with the username)
will be Base64 encoded before sending it out so don't
worry about a clear text password being sent over
the network.
IOException
- Thrown if opening the connection to the URL fails.Method Detail |
---|
public URLConnection getUrlConnection()
URLConnection
object
created by this class's constructor.
public InputStream getInputStream()
InputStream
from the URLConnection
.
Make sure you remember to call
close()
!!
getUrlConnection()
,
close()
public void close()
InputStream
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |