Package io.minio

Class Http.Body

java.lang.Object
io.minio.Http.Body
Enclosing class:
Http

public static class Http.Body extends Object
HTTP body of RandomAccessFile, ByteBuffer or byte array.
  • Constructor Details

    • Body

      public Body(okhttp3.RequestBody requestBody)
      Creates Body for okhttp3 RequestBody.
    • Body

      public Body(RandomAccessFile file, long length, okhttp3.MediaType contentType, String sha256Hash, String md5Hash)
      Creates Body for RandomAccessFile.
    • Body

      public Body(byte[] data, int length, okhttp3.MediaType contentType, String sha256Hash, String md5Hash)
      Creates Body for byte array.
    • Body

      public Body(Object body, okhttp3.MediaType contentType, String sha256Hash, String md5Hash) throws MinioException
      Creates Body for ByteBuffer, string or XML encodable object.
      Throws:
      MinioException
  • Method Details

    • contentType

      public okhttp3.MediaType contentType()
      Gets content type of this body.
    • sha256Hash

      public String sha256Hash()
      Gets SHA256 hash of this body.
    • md5Hash

      public String md5Hash()
      Gets SHA256 hash of this body.
    • isHttpRequestBody

      public boolean isHttpRequestBody()
      Checks whether this body is okhttp3 RequestBody.
    • headers

      public Http.Headers headers()
      Creates headers for this body.
    • toRequestBody

      public Http.RequestBody toRequestBody() throws MinioException
      Creates HTTP RequestBody for this body.
      Throws:
      MinioException
    • toString

      public String toString()
      Overrides:
      toString in class Object