public class FormDataEntity extends MultipartEntity implements Closeable, net.lecousin.framework.util.AsyncCloseable<IOException>
| Modifier and Type | Class and Description |
|---|---|
static class |
FormDataEntity.PartField
Part for a field.
|
static class |
FormDataEntity.PartFile
Part for a file.
|
boundary, partsCONNECTION, CONTENT_DISPOSITION, CONTENT_ENCODING, CONTENT_LENGTH, CONTENT_TRANSFER_ENCODING, CONTENT_TYPE, CRLF, TRANSFER_ENCODING| Constructor and Description |
|---|
FormDataEntity()
Constructor.
|
FormDataEntity(byte[] boundary)
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.synch.ISynchronizationPoint<IOException> |
closeAsync() |
protected net.lecousin.framework.concurrent.synch.AsyncWork<MimeMessage,IOException> |
createPart(List<MimeHeader> headers,
net.lecousin.framework.io.buffering.IOInMemoryOrFile body,
boolean asReceived) |
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.
|
add, from, generateBoundary, getBodyToSend, getBoundary, getParts, getPartsOfType, parseaddHeader, addHeader, addHeaderRaw, appendHeadersTo, appendHeadersTo, getBodyReceivedAsInput, getBodyReceivedAsOutput, getContentLength, getContentType, getContentTypeValue, getFirstHeader, getFirstHeaderLongValue, getFirstHeaderRawValue, getFirstHeaderValue, getHeaders, getHeaders, getHeadersValues, getLogger, getReadableStream, hasHeader, readHeader, removeHeaders, send, setBodyReceived, setBodyToSend, setContentLength, setHeader, setHeader, setHeaderRawpublic FormDataEntity()
public FormDataEntity(byte[] boundary)
public 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 Closeableclose in interface AutoCloseableIOExceptionpublic net.lecousin.framework.concurrent.synch.ISynchronizationPoint<IOException> closeAsync()
closeAsync in interface net.lecousin.framework.util.AsyncCloseable<IOException>protected net.lecousin.framework.concurrent.synch.AsyncWork<MimeMessage,IOException> createPart(List<MimeHeader> headers, net.lecousin.framework.io.buffering.IOInMemoryOrFile body, boolean asReceived)
createPart in class MultipartEntityCopyright © 2018. All rights reserved.