Interface InputPart

All Known Implementing Classes:
MultipartInputImpl.PartImpl

public interface InputPart
Represents one part of a multipart message.
Version:
$Revision: 1 $
Author:
Bill Burke
  • Field Details

  • Method Details

    • getHeaders

      Returns:
      headers of this part
    • getBodyAsString

      String getBodyAsString() throws IOException
      Throws:
      IOException
    • getBody

      <T> T getBody(Class<T> type, Type genericType) throws IOException
      Throws:
      IOException
    • getBody

      <T> T getBody(GenericType<T> type) throws IOException
      Throws:
      IOException
    • getBody

      default InputStream getBody() throws IOException
      Returns the body content as an input stream.
      Returns:
      the body content
      Throws:
      IOException - if an error occurs reading the content
    • getFileName

      default String getFileName()
      Returns the filename parameter of the content disposition of this Entity.
      Returns:
      the filename or null if one does not exist
    • getMediaType

      MediaType getMediaType()
      Returns:
      "Content-Type" of this part
    • isContentTypeFromMessage

      boolean isContentTypeFromMessage()
      Returns:
      true if the Content-Type was resolved from the message, false if it was resolved from the server default
    • setMediaType

      void setMediaType(MediaType mediaType)
      Change the media type of the body part before you extract it. Useful for specifying a charset.
      Parameters:
      mediaType - media type