Class BaseZeroCopyRequestProducer

java.lang.Object
org.apache.http.nio.client.methods.BaseZeroCopyRequestProducer
All Implemented Interfaces:
Closeable, AutoCloseable, org.apache.http.nio.protocol.HttpAsyncRequestProducer
Direct Known Subclasses:
ZeroCopyPost, ZeroCopyPut

abstract class BaseZeroCopyRequestProducer extends Object implements org.apache.http.nio.protocol.HttpAsyncRequestProducer
  • Field Details

    • requestURI

      private final URI requestURI
    • file

      private final File file
    • accessfile

      private final RandomAccessFile accessfile
    • contentType

      private final org.apache.http.entity.ContentType contentType
    • fileChannel

      private FileChannel fileChannel
    • idx

      private long idx
  • Constructor Details

  • Method Details

    • closeChannel

      private void closeChannel() throws IOException
      Throws:
      IOException
    • createRequest

      protected abstract org.apache.http.HttpEntityEnclosingRequest createRequest(URI requestURI, org.apache.http.HttpEntity entity)
    • generateRequest

      public org.apache.http.HttpRequest generateRequest() throws IOException, org.apache.http.HttpException
      Specified by:
      generateRequest in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
      Throws:
      IOException
      org.apache.http.HttpException
    • getTarget

      public org.apache.http.HttpHost getTarget()
      Specified by:
      getTarget in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
    • produceContent

      public void produceContent(org.apache.http.nio.ContentEncoder encoder, org.apache.http.nio.IOControl ioctrl) throws IOException
      Specified by:
      produceContent in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
      Throws:
      IOException
    • requestCompleted

      public void requestCompleted(org.apache.http.protocol.HttpContext context)
      Specified by:
      requestCompleted in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
    • failed

      public void failed(Exception ex)
      Specified by:
      failed in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
    • isRepeatable

      public boolean isRepeatable()
      Specified by:
      isRepeatable in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
    • resetRequest

      public void resetRequest() throws IOException
      Specified by:
      resetRequest in interface org.apache.http.nio.protocol.HttpAsyncRequestProducer
      Throws:
      IOException
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Throws:
      IOException