Class URLStreamer


  • public final class URLStreamer
    extends Object
    Provides a quick and easy way to stream a URL.
    Author:
    Pascal Essiembre
    • Method Detail

      • 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