public class MultipartEncodedDataProcessor extends Object implements FormDataProcessor
FormDataProcessor.| Modifier and Type | Field and Description |
|---|---|
static String |
CONTENT_TYPE |
| Constructor and Description |
|---|
MultipartEncodedDataProcessor() |
| Modifier and Type | Method and Description |
|---|---|
String |
getSupportetContentType()
Returns
FormDataProcessor implementation supporting Content-Type. |
protected boolean |
isPayload(Object value)
Checks is passed object a supported file's type or not.
|
void |
process(Map<String,Object> data,
feign.RequestTemplate template)
Processing form data to request body.
|
protected void |
writeByteArray(OutputStream output,
PrintWriter writer,
String name,
String originalFilename,
String contentType,
byte[] bytes)
Writes file's content to output stream as a byte array.
|
protected void |
writeByteOrFile(OutputStream output,
PrintWriter writer,
String name,
Object value)
Writes file's content to output stream.
|
protected void |
writeFile(OutputStream output,
PrintWriter writer,
String name,
String contentType,
File file)
Writes file to output stream as a
File. |
public static final String CONTENT_TYPE
public void process(Map<String,Object> data, feign.RequestTemplate template)
FormDataProcessorprocess in interface FormDataProcessordata - form data, where key is a parameter name and value is...a value.template - current request object.public String getSupportetContentType()
FormDataProcessorFormDataProcessor implementation supporting Content-Type.getSupportetContentType in interface FormDataProcessorprotected boolean isPayload(Object value)
value - form file parameter.protected void writeByteOrFile(OutputStream output, PrintWriter writer, String name, Object value)
output - output stream to remote destination.writer - wrapped output stream.name - the name of the file.value - file's content. Byte array or File.protected void writeFile(OutputStream output, PrintWriter writer, String name, String contentType, File file)
File.output - output stream to remote destination.writer - wrapped output stream.name - the name of the file.contentType - the content type (if known).file - file object.protected void writeByteArray(OutputStream output, PrintWriter writer, String name, String originalFilename, String contentType, byte[] bytes)
output - utput stream to remote destination.writer - wrapped output stream.name - the name of the file.originalFilename - the original filename (as on the client's machine).contentType - the content type (if known).bytes - file's content.Copyright © 2017 Pivotal Software, Inc.. All rights reserved.