Class URLTxtReaderPipe

  • All Implemented Interfaces:
    Closeable, AutoCloseable, BasePipe, Pipe<String>

    public class URLTxtReaderPipe
    extends InputStreamPipe<String>
    A source pipe providing the lines of a text resource defined by a URL. All valid URL scheme types supported by the JDK are supported here, and not just HTTP URLs. For HTTP URLs, server side exceptions are represented as HttpPipeException, which also include the status code. Redirects are supported. Supports decompression.
    Author:
    Michal Rockban, Eyal Schneider
    • Constructor Detail

      • URLTxtReaderPipe

        public URLTxtReaderPipe​(URL url,
                                Charset charset,
                                FileReadOptions options,
                                int connectTimeoutMs,
                                int readTimeoutMs)
        Constructor
        Parameters:
        url - the URL of the file.
        charset - The charset used
        options - The file read options
        connectTimeoutMs - Connect timeout in milli seconds
        readTimeoutMs - Read timeout in millis seconds
      • URLTxtReaderPipe

        public URLTxtReaderPipe​(URL url)
        Constructor Uses defaults: UTF8 charset, no compression, and default timeouts.
        Parameters:
        url - the URL of the file.