Class MultipartRequest.FilePart

java.lang.Object
io.mochaapi.client.multipart.MultipartRequest.FilePart
Enclosing class:
MultipartRequest

public static class MultipartRequest.FilePart extends Object
Represents a file part in a multipart request.
  • Method Details

    • getFieldName

      public String getFieldName()
      Returns the form field name.
      Returns:
      field name
    • getFile

      public File getFile()
      Returns the file.
      Returns:
      file
    • getFilename

      public String getFilename()
      Returns the filename.
      Returns:
      filename
    • getContentType

      public String getContentType()
      Returns the content type.
      Returns:
      content type
    • getSize

      public long getSize()
      Returns the file size in bytes.
      Returns:
      file size
    • getContent

      public byte[] getContent() throws IOException
      Reads the file content as bytes.
      Returns:
      file content
      Throws:
      IOException - if reading fails
    • toString

      public String toString()
      Overrides:
      toString in class Object