Package org.apache.juneau.rest.httppart
Class RequestFormParam
java.lang.Object
org.apache.juneau.rest.httppart.RequestHttpPart
org.apache.juneau.rest.httppart.RequestFormParam
- All Implemented Interfaces:
NameValuePair
Represents a single form-data parameter on an HTTP request.
Typically accessed through the RequestFormParams
class.
Some important methods on this class are:
RequestFormParam
- Methods for retrieving simple string values:
- Methods for retrieving as other common types:
- Methods for retrieving as custom types:
- Methods for performing assertion checks:
- Other methods:
See Also:
-
Constructor Summary
ConstructorDescriptionRequestFormParam
(RestRequest request, jakarta.servlet.http.Part part) Constructor.RequestFormParam
(RestRequest request, String name, String value) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturns the content type of this part.Returns the value of the specified mime header as a String.Returns the header names of this param.getHeaders
(String name) Returns the values of the param header with the given name.long
getSize()
Returns the size of this file.Returns this part value as an input stream.Returns the file name specified by the client.getValue()
Returns the value of this part.parser
(HttpPartParserSession value) Specifies the part parser to use for this part.schema
(HttpPartSchema value) Specifies the part schema for this part.Methods inherited from class org.apache.juneau.rest.httppart.RequestHttpPart
as, as, as, asBoolean, asBooleanPart, asCsvArray, asCsvArrayPart, asDate, asDatePart, asInteger, asIntegerPart, asLong, asLongPart, asMatcher, asMatcher, asMatcher, assertCsvArray, assertDate, assertInteger, assertLong, assertString, asString, asStringPart, asUriPart, def, get, getName, getRequest, isPresent, orElse, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.http.NameValuePair
getName
-
Constructor Details
-
RequestFormParam
Constructor.- Parameters:
request
- The request object.part
- The HTTP part.
-
RequestFormParam
Constructor.- Parameters:
request
- The request object.name
- The parameter name.value
- The parameter value.
-
-
Method Details
-
getValue
Description copied from class:RequestHttpPart
Returns the value of this part.- Specified by:
getValue
in interfaceNameValuePair
- Overrides:
getValue
in classRequestHttpPart
- 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
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
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 classRequestHttpPart
- 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 classRequestHttpPart
- Parameters:
value
- The new part parser to use for this part.
Ifnull ,SimplePartParser.DEFAULT
will be used.- Returns:
- This object.
-