use of com.koushikdutta.async.http.body.FilePart in project ion by koush.
the class IonRequestBuilder method setMultipartFile.
@Override
public IonRequestBuilder setMultipartFile(String name, String contentType, File file) {
if (multipartBody == null) {
multipartBody = new MultipartFormDataBody();
setBody(multipartBody);
}
FilePart part = new FilePart(name, file);
if (contentType == null)
contentType = AsyncHttpServer.tryGetContentType(file.getAbsolutePath());
if (contentType != null)
part.setContentType(contentType);
multipartBody.addPart(part);
return this;
}
Aggregations