com.sibvisions.util.type
Class HttpUtil

java.lang.Object
  extended by com.sibvisions.util.type.HttpUtil

public final class HttpUtil
extends Object

The HttpUtil is a utility class for http communication.


Method Summary
static InputStream get(String pURL)
          Sends a get request.
static InputStream post(String pURL)
          Sends an empty post request.
static InputStream post(String pURL, File pFile)
          Sends a post request with given file.
static InputStream post(String pURL, InputStream pStream)
          Sends a post request with given data.
static InputStream post(String pURL, InputStream pStream, String pFileName)
          Sends a post request with given content.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

post

public static InputStream post(String pURL)
                        throws Exception
Sends an empty post request.

Parameters:
pURL - the URL
Returns:
the response stream
Throws:
Exception - if communication failed

post

public static InputStream post(String pURL,
                               InputStream pStream)
                        throws Exception
Sends a post request with given data.

Parameters:
pURL - the URL
pStream - the content to send
Returns:
the response stream
Throws:
Exception - if communication failed

post

public static InputStream post(String pURL,
                               File pFile)
                        throws Exception
Sends a post request with given file.

Parameters:
pURL - the URL
pFile - the file
Returns:
the response stream
Throws:
Exception - if communication failed

post

public static InputStream post(String pURL,
                               InputStream pStream,
                               String pFileName)
                        throws Exception
Sends a post request with given content.

Parameters:
pURL - the URL
pStream - the content to send
pFileName - the file name
Returns:
the response stream
Throws:
Exception - if communication failed

get

public static InputStream get(String pURL)
                       throws Exception
Sends a get request.

Parameters:
pURL - the URL
Returns:
the response stream
Throws:
Exception - if communication failed


Copyright © 2009 SIB Visions GmbH. All Rights Reserved.