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
ConstructorsConstructorDescriptionRequestFormParam(RestRequest request, jakarta.servlet.http.Part part) Constructor.RequestFormParam(RestRequest request, String name, String value) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionSets a default value for this part.Returns 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.longgetSize()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, get, getName, getRequest, isPresent, orElse, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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
-
def
Description copied from class:RequestHttpPartSets a default value for this part.- Overrides:
defin classRequestHttpPart- Parameters:
def- The default value.- Returns:
- This object.
-
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.
-
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.
-
getSubmittedFileName
Returns the file name specified by the client.- Returns:
- The file name specified by the client.
-
getValue
Description copied from class:RequestHttpPartReturns the value of this part.- Specified by:
getValuein interfaceNameValuePair- Overrides:
getValuein classRequestHttpPart- Returns:
- The value of this part.
-
parser
Description copied from class:RequestHttpPartSpecifies 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:
parserin classRequestHttpPart- Parameters:
value- The new part parser to use for this part.
Ifnull ,SimplePartParser.DEFAULTwill be used.- Returns:
- This object.
-
schema
Description copied from class:RequestHttpPartSpecifies the part schema for this part.Used by schema-based part parsers such as
OpenApiParser.- Overrides:
schemain classRequestHttpPart- Parameters:
value- The part schema.- Returns:
- This object.
-