Skip to content

Migrate to HttpClient 5.x #515

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions ms2/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,6 @@ plugins {
}

dependencies {
BuildUtils.addExternalDependency(
project,
new ExternalDependency(
"org.apache.httpcomponents:httpmime:${httpmimeVersion}",
"Apache HTTP Mime",
"Apache",
"http://hc.apache.org/httpcomponents-client-ga",
ExternalDependency.APACHE_2_LICENSE_NAME,
ExternalDependency.APACHE_2_LICENSE_URL,
"HTTP client for requests of remote servers"
)
)
BuildUtils.addExternalDependency(
project,
new ExternalDependency(
Expand Down
16 changes: 8 additions & 8 deletions ms2/src/org/labkey/ms2/pipeline/mascot/MascotClientImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
import org.apache.commons.beanutils.converters.BooleanConverter;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.mime.MultipartEntityBuilder;
import org.apache.http.entity.mime.content.FileBody;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.apache.logging.log4j.Logger;
import org.apache.hc.client5.http.classic.methods.HttpPost;
import org.apache.hc.client5.http.entity.mime.FileBody;
import org.apache.hc.client5.http.entity.mime.MultipartEntityBuilder;
import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
import org.apache.hc.client5.http.impl.classic.HttpClients;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.junit.Assert;
import org.junit.Assume;
import org.junit.Test;
Expand Down Expand Up @@ -1196,7 +1196,7 @@ protected boolean submitFile (String sessionID, String taskID,
{
try (CloseableHttpResponse response = httpclient.execute(post))
{
if (-1 == response.getStatusLine().getStatusCode())
if (-1 == response.getCode())
continue;

boolean uploadFinished = false;
Expand Down