|
@@ -13,7 +13,6 @@ import java.util.concurrent.TimeoutException;
|
|
|
|
|
|
import org.apache.http.HttpResponse;
|
|
|
import org.apache.http.client.methods.HttpGet;
|
|
|
-import org.apache.http.impl.client.BasicResponseHandler;
|
|
|
import org.apache.http.impl.client.CloseableHttpClient;
|
|
|
import org.apache.http.impl.client.HttpClients;
|
|
|
import org.asynchttpclient.AsyncCompletionHandler;
|
|
@@ -91,14 +90,14 @@ public class AsyncHttpClientService {
|
|
|
CloseableHttpClient httpclient = HttpClients.createDefault();
|
|
|
HttpGet httpGet = new HttpGet(url);
|
|
|
HttpResponse resp = httpclient.execute(httpGet);
|
|
|
- String responseBody = new BasicResponseHandler().handleResponse(resp);
|
|
|
- httpclient.close();
|
|
|
- InputStream is = new ByteArrayInputStream(responseBody.getBytes());
|
|
|
- control.uploadArtifact(is,name);
|
|
|
+ InputStream content = resp.getEntity().getContent();
|
|
|
+ control.uploadArtifact(content,name);
|
|
|
TraceArtifact tArt = new TraceArtifact();
|
|
|
tArt.setLocation(name);
|
|
|
tArt.setRelatesTo(dataOutputPort.getArtifact());
|
|
|
traceArts.add(tArt);
|
|
|
+ content.close();
|
|
|
+ httpclient.close();
|
|
|
}
|
|
|
}
|
|
|
}
|