Class ProxyServlet.ProxyInputStreamContentProvider

    • Constructor Detail

      • ProxyInputStreamContentProvider

        protected ProxyInputStreamContentProvider​(javax.servlet.http.HttpServletRequest request,
                                                  javax.servlet.http.HttpServletResponse response,
                                                  Request proxyRequest,
                                                  java.io.InputStream input)
    • Method Detail

      • onRead

        protected java.nio.ByteBuffer onRead​(byte[] buffer,
                                             int offset,
                                             int length)
        Description copied from class: InputStreamContentProvider
        Callback method invoked just after having read from the stream, but before returning the iteration element (a ByteBuffer to the caller.

        Subclasses may override this method to copy the content read from the stream to another location (a file, or in memory if the content is known to fit).

        Overrides:
        onRead in class InputStreamContentProvider
        Parameters:
        buffer - the byte array containing the bytes read
        offset - the offset from where bytes should be read
        length - the length of the bytes read
        Returns:
        a ByteBuffer wrapping the byte array
      • onRequestContent

        protected java.nio.ByteBuffer onRequestContent​(javax.servlet.http.HttpServletRequest request,
                                                       Request proxyRequest,
                                                       byte[] buffer,
                                                       int offset,
                                                       int length)
      • onReadFailure

        protected void onReadFailure​(java.lang.Throwable failure)
        Description copied from class: InputStreamContentProvider
        Callback method invoked when an exception is thrown while reading from the stream.
        Overrides:
        onReadFailure in class InputStreamContentProvider
        Parameters:
        failure - the exception thrown while reading from the stream.