Class RequestFormParam

java.lang.Object
org.apache.juneau.rest.httppart.RequestHttpPart
org.apache.juneau.rest.httppart.RequestFormParam
All Implemented Interfaces:
NameValuePair

public class RequestFormParam extends RequestHttpPart implements NameValuePair
Represents a single form-data parameter on an HTTP request.

Typically accessed through the RequestFormParams class.

Some important methods on this class are:

  • Constructor Details

    • RequestFormParam

      public RequestFormParam(RestRequest request, jakarta.servlet.http.Part part)
      Constructor.
      Parameters:
      request - The request object.
      part - The HTTP part.
    • RequestFormParam

      public RequestFormParam(RestRequest request, String name, String value)
      Constructor.
      Parameters:
      request - The request object.
      name - The parameter name.
      value - The parameter value.
  • Method Details

    • getValue

      public String getValue()
      Description copied from class: RequestHttpPart
      Returns the value of this part.
      Specified by:
      getValue in interface NameValuePair
      Overrides:
      getValue in class RequestHttpPart
      Returns:
      The value of this part.
    • getStream

      Returns this part value as an input stream.
      Returns:
      This part value as an input stream.
      Throws:
      IOException - If an error occurs in retrieving the content.
    • getContentType

      Returns the content type of this part.
      Returns:
      The content type of this part, or null if not known.
    • getHeader

      public String getHeader(String name)
      Returns the value of the specified mime header as a String.

      If the Part did not include a header of the specified name, this method returns null. If there are multiple headers with the same name, this method returns the first header in the part. The header name is case insensitive. You can use this method with any request header.

      Parameters:
      name - The header name.
      Returns:
      The value of the specified mime header as a String.
    • getHeaderNames

      Returns the header names of this param.
      Returns:
      The header names of this param.
    • getHeaders

      Returns the values of the param header with the given name.
      Parameters:
      name - The param name.
      Returns:
      The values of the param header with the given name.
    • getSize

      public long getSize()
      Returns the size of this file.
      Returns:
      A long specifying the size of this part, in bytes.
    • getSubmittedFileName

      Returns the file name specified by the client.
      Returns:
      The file name specified by the client.
    • schema

      Description copied from class: RequestHttpPart
      Specifies the part schema for this part.

      Used by schema-based part parsers such as OpenApiParser.

      Overrides:
      schema in class RequestHttpPart
      Parameters:
      value - The part schema.
      Returns:
      This object.
    • parser

      Description copied from class: RequestHttpPart
      Specifies the part parser to use for this part.

      If not specified, uses the part parser defined on the client by calling RestContext.Builder.partParser().

      Overrides:
      parser in class RequestHttpPart
      Parameters:
      value - The new part parser to use for this part.
      If null, SimplePartParser.DEFAULT will be used.
      Returns:
      This object.