Package hudson.cli

Class FullDuplexHttpStream


  • public class FullDuplexHttpStream
    extends Object
    Creates a capacity-unlimited bi-directional InputStream/OutputStream pair over HTTP, which is a request/response protocol. FullDuplexHttpService is the counterpart on the server side.
    Author:
    Kohsuke Kawaguchi
    • Constructor Detail

      • FullDuplexHttpStream

        public FullDuplexHttpStream​(URL base,
                                    String relativeTarget,
                                    String authorization)
                             throws IOException
        Parameters:
        base - the base URL of Jenkins.
        relativeTarget - The endpoint that we are making requests to.
        authorization - The value of the authorization header.
        Throws:
        IOException
    • Method Detail

      • getInputStream

        public InputStream getInputStream()
        Get data from the server. An initial zero byte is used as a handshake which you should expect and ignore.
      • getOutputStream

        public OutputStream getOutputStream()
        Upload data to the server. You will need to write to this and OutputStream.flush() it to establish a connection.