GLMills
GLMills

Reputation: 638

MultipartEntityBuilder package org.apache.http.entity.mime does not exist

I am trying to use MultipartEntityBuilder, following http://hilton.org.uk/blog/camel-multipart-form-data blog on doing multipart form encodeing with Camel, but it when I compile it says the package doesn't exist?? I see it on https://hc.apache.org/httpcomponents-client-ga/httpmime/apidocs/org/apache/http/entity/mime/MultipartEntityBuilder.html

does anyone know the solution to this? thank you!

import java.lang.StringBuilder;
import java.net.URLEncoder;
import java.util.Base64;

import org.apache.camel.Exchange;
import org.apache.camel.Message;
import org.apache.camel.Processor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.apache.camel.LoggingLevel;
import org.apache.http.entity.mime.MultipartEntityBuilder;

compile gives

java:[13,35] error: package org.apache.http.entity.mime does not exist

Upvotes: 5

Views: 6854

Answers (1)

GLMills
GLMills

Reputation: 638

found that a maven dependency is needed.

after adding this to my POM, it now compiles without complaint.

<!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpmime -->
<dependency>
    <groupId>org.apache.httpcomponents</groupId>
    <artifactId>httpmime</artifactId>
    <version>4.3.1</version>
</dependency>

Upvotes: 9

Related Questions