Class PathRequestContent

    • Constructor Detail

      • PathRequestContent

        public PathRequestContent​(java.nio.file.Path filePath)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • PathRequestContent

        public PathRequestContent​(java.nio.file.Path filePath,
                                  int bufferSize)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • PathRequestContent

        public PathRequestContent​(java.lang.String contentType,
                                  java.nio.file.Path filePath)
                           throws java.io.IOException
        Throws:
        java.io.IOException
      • PathRequestContent

        public PathRequestContent​(java.lang.String contentType,
                                  java.nio.file.Path filePath,
                                  int bufferSize)
                           throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • getLength

        public long getLength()
        Returns:
        the content length, if known, or -1 if the content length is unknown
      • isReproducible

        public boolean isReproducible()
        Description copied from interface: Request.Content

        Whether this content producer can produce exactly the same content more than once.

        Implementations should return true only if the content can be produced more than once, which means that Request.Content.subscribe(Consumer, boolean) may be called again.

        The HttpClient implementation may use this method in particular cases where it detects that it is safe to retry a request that failed.

        Returns:
        whether the content can be produced more than once
      • setByteBufferPool

        public void setByteBufferPool​(ByteBufferPool byteBufferPool)
      • isUseDirectByteBuffers

        public boolean isUseDirectByteBuffers()
      • setUseDirectByteBuffers

        public void setUseDirectByteBuffers​(boolean useDirectByteBuffers)