com.cassinidivision.core.cassinijava
Class InputStreamHelper

java.lang.Object
  extended bycom.cassinidivision.core.cassinijava.InputStreamHelper

public class InputStreamHelper
extends Object

Miscellaneous InputStream-based utilities.


Constructor Summary
InputStreamHelper()
           
 
Method Summary
static String getContentsOfUrl(String urlString)
          Requests the URL specified and returns the body content from the response.
static String stringFromReadingEntireInputStream(InputStream s)
          Reads an arbitrary input stream and returns the contents into a string.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InputStreamHelper

public InputStreamHelper()
Method Detail

getContentsOfUrl

public static String getContentsOfUrl(String urlString)
                               throws IOException
Requests the URL specified and returns the body content from the response.

Parameters:
urlString - A suitable URL string.
Returns:
The body content returned in the HTTP response.
Throws:
IOException

stringFromReadingEntireInputStream

public static String stringFromReadingEntireInputStream(InputStream s)
                                                 throws IOException
Reads an arbitrary input stream and returns the contents into a string.

Parameters:
s - The source input stream.
Returns:
String containing the contents of the stream.
Throws:
IOException