Package com.norconex.commons.lang.url

# Class UrlStreamer

java.lang.Object
com.norconex.commons.lang.url.UrlStreamer

public final class UrlStreamer extends Object
Provides a quick and easy way to stream a URL.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `UrlStreamer.HttpHost`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static InputStream`
  `stream(HttpURL url)`
  Streams URL content.
  `static InputStream`
  `stream(HttpURL url, Credentials creds)`
  Streams URL content.
  `static InputStream`
  `stream(HttpURL url, Credentials creds, UrlStreamer.HttpHost proxy)`
  Streams URL content.
  `static InputStream`
  `stream(HttpURL url, Credentials creds, UrlStreamer.HttpHost proxy, Credentials proxyCreds)`
  Streams URL content.
  `static InputStream`
  `stream(String url)`
  Streams URL content.
  `static InputStream`
  `stream(String url, Credentials creds)`
  Streams URL content.
  `static InputStream`
  `stream(String url, Credentials creds, UrlStreamer.HttpHost proxy)`
  Streams URL content.
  `static InputStream`
  `stream(String url, Credentials creds, UrlStreamer.HttpHost proxy, Credentials proxyCreds)`
  Streams URL content.
  `static InputStream`
  `stream(URL url)`
  Streams URL content.
  `static InputStream`
  `stream(URL url, Credentials creds)`
  Streams URL content.
  `static InputStream`
  `stream(URL url, Credentials creds, UrlStreamer.HttpHost proxy)`
  Streams URL content.
  `static InputStream`
  `stream(URL url, Credentials creds, UrlStreamer.HttpHost proxy, Credentials proxyCreds)`
  Streams URL content.
  `static String`
  `streamToString(HttpURL url)`
  Streams URL content to a String.
  `static String`
  `streamToString(HttpURL url, Credentials creds)`
  Streams URL content to a String.
  `static String`
  `streamToString(HttpURL url, Credentials creds, UrlStreamer.HttpHost proxy)`
  Streams URL content to a String.
  `static String`
  `streamToString(HttpURL url, Credentials creds, UrlStreamer.HttpHost proxy, Credentials proxyCreds)`
  Streams URL content to a String.
  `static String`
  `streamToString(String url)`
  Streams URL content to a String.
  `static String`
  `streamToString(String url, Credentials creds)`
  Streams URL content to a String.
  `static String`
  `streamToString(String url, Credentials creds, UrlStreamer.HttpHost proxy)`
  Streams URL content to a String using UTF-8 character encoding.
  `static String`
  `streamToString(String url, Credentials creds, UrlStreamer.HttpHost proxy, Credentials proxyCreds)`
  Streams URL content to a String using UTF-8 character encoding.
  `static String`
  `streamToString(String url, Credentials creds, UrlStreamer.HttpHost proxy, Credentials proxyCreds, String charEncoding)`
  Streams URL content to a String.
  `static String`
  `streamToString(String url, Credentials creds, UrlStreamer.HttpHost proxy, String charEncoding)`
  Streams URL content to a String.
  `static String`
  `streamToString(URL url)`
  Streams URL content to a String.
  `static String`
  `streamToString(URL url, Credentials creds)`
  Streams URL content to a String.
  `static String`
  `streamToString(URL url, Credentials creds, UrlStreamer.HttpHost proxy)`
  Streams URL content to a String.
  `static String`
  `streamToString(URL url, Credentials creds, UrlStreamer.HttpHost proxy, Credentials proxyCreds)`
  Streams URL content to a String.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Method Details

  - ### stream

    public static InputStream stream(String url)
    Streams URL content.
    Parameters:
      `url` - the URL to stream
    Returns:
      a URL content InputStream

  - ### stream

    public static InputStream stream(URL url)
    Streams URL content.
    Parameters:
      `url` - the URL to stream
    Returns:
      a URL content InputStream

  - ### stream

    public static InputStream stream(HttpURL url)
    Streams URL content.
    Parameters:
      `url` - the URL to stream
    Returns:
      a URL content InputStream

  - ### stream

    public static InputStream stream(String url, Credentials creds)
    Streams URL content.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
    Returns:
      a URL content InputStream

  - ### stream

    public static InputStream stream(URL url, Credentials creds)
    Streams URL content.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
    Returns:
      a URL content InputStream

  - ### stream

    public static InputStream stream(HttpURL url, Credentials creds)
    Streams URL content.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
    Returns:
      a URL content InputStream

  - ### stream

    public static InputStream stream(String url, Credentials creds, UrlStreamer.HttpHost proxy)
    Streams URL content.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
      `proxy` - proxy to use to stream the URL
    Returns:
      a URL content InputStream

  - ### stream

    public static InputStream stream(URL url, Credentials creds, UrlStreamer.HttpHost proxy)
    Streams URL content.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
      `proxy` - proxy to use to stream the URL
    Returns:
      a URL content InputStream

  - ### stream

    public static InputStream stream(HttpURL url, Credentials creds, UrlStreamer.HttpHost proxy)
    Streams URL content.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
      `proxy` - proxy to use to stream the URL
    Returns:
      a URL content InputStream

  - ### stream

    public static InputStream stream(String url, Credentials creds, UrlStreamer.HttpHost proxy, Credentials proxyCreds)
    Streams URL content.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
      `proxy` - proxy to use to stream the URL
      `proxyCreds` - credentials to access the proxy
    Returns:
      a URL content InputStream

  - ### stream

    public static InputStream stream(URL url, Credentials creds, UrlStreamer.HttpHost proxy, Credentials proxyCreds)
    Streams URL content.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
      `proxy` - proxy to use to stream the URL
      `proxyCreds` - credentials to access the proxy
    Returns:
      a URL content InputStream

  - ### stream

    public static InputStream stream(HttpURL url, Credentials creds, UrlStreamer.HttpHost proxy, Credentials proxyCreds)
    Streams URL content.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
      `proxy` - proxy to use to stream the URL
      `proxyCreds` - credentials to access the proxy
    Returns:
      a URL content InputStream

  - ### streamToString

    public static String streamToString(String url, Credentials creds, UrlStreamer.HttpHost proxy)
    Streams URL content to a String using UTF-8 character encoding.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
      `proxy` - proxy to use to stream the URL
    Returns:
      a URL content as a String

  - ### streamToString

    public static String streamToString(String url, Credentials creds, UrlStreamer.HttpHost proxy, String charEncoding)
    Streams URL content to a String.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
      `proxy` - proxy to use to stream the URL
      `charEncoding` - character encoding
    Returns:
      a URL content as a String

  - ### streamToString

    public static String streamToString(URL url, Credentials creds, UrlStreamer.HttpHost proxy)
    Streams URL content to a String.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
      `proxy` - proxy to use to stream the URL
    Returns:
      a URL content as a String

  - ### streamToString

    public static String streamToString(HttpURL url, Credentials creds, UrlStreamer.HttpHost proxy)
    Streams URL content to a String.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
      `proxy` - proxy to use to stream the URL
    Returns:
      a URL content as a String

  - ### streamToString

    public static String streamToString(String url, Credentials creds, UrlStreamer.HttpHost proxy, Credentials proxyCreds)
    Streams URL content to a String using UTF-8 character encoding.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
      `proxy` - proxy to use to stream the URL
      `proxyCreds` - credentials to access the proxy
    Returns:
      a URL content as a String

  - ### streamToString

    public static String streamToString(String url, Credentials creds, UrlStreamer.HttpHost proxy, Credentials proxyCreds, String charEncoding)
    Streams URL content to a String.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
      `proxy` - proxy to use to stream the URL
      `proxyCreds` - credentials to access the proxy
      `charEncoding` - character encoding
    Returns:
      a URL content as a String

  - ### streamToString

    public static String streamToString(URL url, Credentials creds, UrlStreamer.HttpHost proxy, Credentials proxyCreds)
    Streams URL content to a String.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
      `proxy` - proxy to use to stream the URL
      `proxyCreds` - credentials to access the proxy
    Returns:
      a URL content as a String

  - ### streamToString

    public static String streamToString(HttpURL url, Credentials creds, UrlStreamer.HttpHost proxy, Credentials proxyCreds)
    Streams URL content to a String.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
      `proxy` - proxy to use to stream the URL
      `proxyCreds` - credentials to access the proxy
    Returns:
      a URL content as a String

  - ### streamToString

    public static String streamToString(String url, Credentials creds)
    Streams URL content to a String.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
    Returns:
      a URL content as a String

  - ### streamToString

    public static String streamToString(URL url, Credentials creds)
    Streams URL content to a String.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
    Returns:
      a URL content as a String

  - ### streamToString

    public static String streamToString(HttpURL url, Credentials creds)
    Streams URL content to a String.
    Parameters:
      `url` - the URL to stream
      `creds` - credentials for a protected URL
    Returns:
      a URL content as a String

  - ### streamToString

    public static String streamToString(String url)
    Streams URL content to a String.
    Parameters:
      `url` - the URL to stream
    Returns:
      a URL content as a String
    Since:
      1.3

  - ### streamToString

    public static String streamToString(URL url)
    Streams URL content to a String.
    Parameters:
      `url` - the URL to stream
    Returns:
      a URL content as a String
    Since:
      1.3

  - ### streamToString

    public static String streamToString(HttpURL url)
    Streams URL content to a String.
    Parameters:
      `url` - the URL to stream
    Returns:
      a URL content as a String
    Since:
      1.3