public class FormDataEntity extends MultipartEntity implements AutoCloseable, net.lecousin.framework.util.AsyncCloseable<IOException>
| Modifier and Type | Class and Description |
|---|---|
static class |
FormDataEntity.FormDataPartFactory
Factory to create PartField or PartFile depending on headers.
|
static class |
FormDataEntity.PartField
Part for a field.
|
static class |
FormDataEntity.PartFile
Part for a file.
|
MultipartEntity.BodyProducer, MultipartEntity.ParserMimeEntity.Transfer| Modifier and Type | Field and Description |
|---|---|
static String |
MULTIPART_SUB_TYPE |
boundary, MAIN_CONTENT_TYPE, partFactory, partsheaders, parent| Constructor and Description |
|---|
FormDataEntity()
Constructor.
|
FormDataEntity(byte[] boundary)
Constructor.
|
FormDataEntity(MimeEntity parent,
MimeHeaders headers)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
FormDataEntity.PartField |
addField(String name,
String value,
Charset charset)
Append a field with a value.
|
FormDataEntity.PartFile |
addFile(String fieldName,
String filename,
ParameterizedHeaderValue contentType,
net.lecousin.framework.io.IO.Readable content)
Append a file.
|
void |
close() |
net.lecousin.framework.concurrent.async.IAsync<IOException> |
closeAsync() |
List<net.lecousin.framework.util.Pair<String,String>> |
getFields()
Return the fields contained in the form-data.
|
String |
getFieldValue(String name)
Return the value of the given field.
|
FormDataEntity.PartFile |
getFile(String name)
Return the file corresponding to the field of the given name.
|
void |
setPartFactory(MimeEntityFactory partFactory) |
add, canProduceBodyRange, createBodyProducer, createBodyRange, createConsumer, generateBoundary, getBoundary, getPartFactory, getParts, getPartsOfTypegetHeaders, getParent, parse, writeEntitypublic static final String MULTIPART_SUB_TYPE
public FormDataEntity()
public FormDataEntity(byte[] boundary)
public FormDataEntity(MimeEntity parent, MimeHeaders headers) throws MimeException
MimeExceptionpublic void setPartFactory(MimeEntityFactory partFactory)
setPartFactory in class MultipartEntitypublic FormDataEntity.PartField addField(String name, String value, Charset charset)
public FormDataEntity.PartFile addFile(String fieldName, String filename, ParameterizedHeaderValue contentType, net.lecousin.framework.io.IO.Readable content)
public List<net.lecousin.framework.util.Pair<String,String>> getFields()
public FormDataEntity.PartFile getFile(String name)
public void close()
throws IOException
close in interface AutoCloseableIOExceptionpublic net.lecousin.framework.concurrent.async.IAsync<IOException> closeAsync()
closeAsync in interface net.lecousin.framework.util.AsyncCloseable<IOException>Copyright © 2020. All rights reserved.