com.uwyn.rife.tools
Class HttpUtils

java.lang.Object
  extended by com.uwyn.rife.tools.HttpUtils

public abstract class HttpUtils
extends Object


Nested Class Summary
static class HttpUtils.Page
           
static class HttpUtils.Request
           
 
Field Summary
static String CHARSET
           
static Pattern CHARSET_PATTERN
           
 
Constructor Summary
HttpUtils()
           
 
Method Summary
static String extractMimeTypeFromContentType(String contentType)
          Extracts only the mime-type from a Content-Type HTTP header.
static String getConnectionContent(HttpURLConnection connection)
           
static boolean getConnectionContent(HttpURLConnection connection, OutputStream output)
           
static HttpUtils.Page retrievePage(String absoluteUrl)
           
static HttpUtils.Page retrievePage(String absoluteUrl, boolean downloadContent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CHARSET

public static final String CHARSET
See Also:
Constant Field Values

CHARSET_PATTERN

public static final Pattern CHARSET_PATTERN
Constructor Detail

HttpUtils

public HttpUtils()
Method Detail

extractMimeTypeFromContentType

public static String extractMimeTypeFromContentType(String contentType)
Extracts only the mime-type from a Content-Type HTTP header. Thus a header like this: text/html;charset=UTF-8 will return: text/html

Parameters:
contentType - the Content-Type header
Returns:
the content type header without the charset
Since:
1.6

getConnectionContent

public static String getConnectionContent(HttpURLConnection connection)
                                   throws IOException
Throws:
IOException

getConnectionContent

public static boolean getConnectionContent(HttpURLConnection connection,
                                           OutputStream output)
                                    throws IOException
Throws:
IOException

retrievePage

public static HttpUtils.Page retrievePage(String absoluteUrl)
                                   throws IOException
Throws:
IOException

retrievePage

public static HttpUtils.Page retrievePage(String absoluteUrl,
                                          boolean downloadContent)
                                   throws IOException
Throws:
IOException


Copyright © 2001-2007 Uwyn sprl/bvba. All Rights Reserved.