org.ops4j.net
Class URLUtils

java.lang.Object
  extended by org.ops4j.net.URLUtils

public class URLUtils
extends java.lang.Object

Url related utility methods.

Since:
0.5.0, January 16, 2008
Author:
Niclas Heldman, Alin Dreghiciu

Method Summary
static java.net.URLConnection prepareForAuthentication(java.net.URLConnection connection)
          Prepares an url connection for authentication if necessary.
static java.net.URLConnection prepareForSSL(java.net.URLConnection connection)
          Prepares an url connection for authentication if necessary.
static java.io.InputStream prepareInputStream(java.net.URL url, boolean acceptAnyCertificate)
          Prepare url for authentication and ssl if necessary and returns the input stream from the url.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

prepareForAuthentication

public static java.net.URLConnection prepareForAuthentication(java.net.URLConnection connection)
Prepares an url connection for authentication if necessary.

Parameters:
connection - the connection to be prepared
Returns:
the prepared conection

prepareForSSL

public static java.net.URLConnection prepareForSSL(java.net.URLConnection connection)
Prepares an url connection for authentication if necessary.

Parameters:
connection - the connection to be prepared
Returns:
the prepared conection

prepareInputStream

public static java.io.InputStream prepareInputStream(java.net.URL url,
                                                     boolean acceptAnyCertificate)
                                              throws java.io.IOException
Prepare url for authentication and ssl if necessary and returns the input stream from the url.

Parameters:
url - url to prepare
acceptAnyCertificate - true if the certicate check should be skipped
Returns:
input stream from url
Throws:
java.io.IOException - re-thrown


Copyright © 2006-2009 OPS4J - Open Participation Software for Java. All Rights Reserved.