Package org.takes.rq.multipart
Class RqMtBase
- java.lang.Object
-
- org.takes.rq.multipart.RqMtBase
-
- All Implemented Interfaces:
Body
,Head
,Request
,RqMultipart
public final class RqMtBase extends Object implements RqMultipart
Request decorator, that decodes FORM data frommultipart/form-data
format (RFC 2045).For
application/x-www-form-urlencoded
format useRqForm
.It is highly recommended to use
RqGreedy
decorator before passing request to this class.The class is immutable and thread-safe.
- Since:
- 0.33
- See Also:
-
Forms in HTML,
RqGreedy
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InputStream
body()
Body.Iterable<String>
head()
All lines above the body.Iterable<String>
names()
Get all part names.Iterable<Request>
part(CharSequence name)
Get single part.
-
-
-
Constructor Detail
-
RqMtBase
public RqMtBase(Request req) throws IOException
Ctor.- Parameters:
req
- Original request- Throws:
IOException
- If fails
-
-
Method Detail
-
part
public Iterable<Request> part(CharSequence name)
Description copied from interface:RqMultipart
Get single part.- Specified by:
part
in interfaceRqMultipart
- Parameters:
name
- Name of the part to get- Returns:
- List of parts (can be empty)
-
names
public Iterable<String> names()
Description copied from interface:RqMultipart
Get all part names.- Specified by:
names
in interfaceRqMultipart
- Returns:
- All names
-
head
public Iterable<String> head() throws IOException
Description copied from interface:Head
All lines above the body.- Specified by:
head
in interfaceHead
- Returns:
- List of lines
- Throws:
IOException
- If something goes wrong
-
body
public InputStream body() throws IOException
Description copied from interface:Body
Body.- Specified by:
body
in interfaceBody
- Returns:
- Stream with body
- Throws:
IOException
- If something goes wrong
-
-