Package hudson.cli

Class FullDuplexHttpStream

java.lang.Object
hudson.cli.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 Details

    • 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 Details

    • 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.