Package org.takes.rq.multipart
Class RqMtSmart
- java.lang.Object
-
- org.takes.rq.multipart.RqMtSmart
-
- All Implemented Interfaces:
Body
,Head
,Request
,RqMultipart
public final class RqMtSmart extends Object implements RqMultipart
Smart decorator.- Since:
- 0.33
-
-
Constructor Summary
Constructors Constructor Description RqMtSmart(Request req)
Ctor.RqMtSmart(RqMultipart req)
Ctor.
-
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.Request
single(CharSequence name)
Get single part.
-
-
-
Constructor Detail
-
RqMtSmart
public RqMtSmart(Request req) throws IOException
Ctor.- Parameters:
req
- Original- Throws:
IOException
- If fails
-
RqMtSmart
public RqMtSmart(RqMultipart req)
Ctor.- Parameters:
req
- Original
-
-
Method Detail
-
single
public Request single(CharSequence name) throws HttpException
Get single part.- Parameters:
name
- Name of the part to get- Returns:
- Part
- Throws:
HttpException
- If fails
-
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
-
-