aboutsummaryrefslogtreecommitdiffstats
path: root/datafile-dmaap-client/src/main/java
diff options
context:
space:
mode:
authorelinuxhenrik <henrik.b.andersson@est.tech>2018-10-02 17:31:50 +0200
committerelinuxhenrik <henrik.b.andersson@est.tech>2018-10-03 08:48:11 +0200
commit874e6b5e33b3e0bf7a362d591467cd80ba7e5b6e (patch)
treee8b10e9ee02c868bc0b6e4df1b8fc8bda03782c9 /datafile-dmaap-client/src/main/java
parent18f56936071b59b6efd61c2764c51ecd52ced74c (diff)
Fix bug in DataRouter file body
Change-Id: Ia3f868c272ebc426b6a694074dbd2a4a2cb7ae32 Issue-ID: DCAEGEN2-850 Signed-off-by: elinuxhenrik <henrik.b.andersson@est.tech>
Diffstat (limited to 'datafile-dmaap-client/src/main/java')
-rw-r--r--datafile-dmaap-client/src/main/java/org/onap/dcaegen2/collectors/datafile/service/producer/DmaapProducerReactiveHttpClient.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/datafile-dmaap-client/src/main/java/org/onap/dcaegen2/collectors/datafile/service/producer/DmaapProducerReactiveHttpClient.java b/datafile-dmaap-client/src/main/java/org/onap/dcaegen2/collectors/datafile/service/producer/DmaapProducerReactiveHttpClient.java
index fae86a82..5cd9056d 100644
--- a/datafile-dmaap-client/src/main/java/org/onap/dcaegen2/collectors/datafile/service/producer/DmaapProducerReactiveHttpClient.java
+++ b/datafile-dmaap-client/src/main/java/org/onap/dcaegen2/collectors/datafile/service/producer/DmaapProducerReactiveHttpClient.java
@@ -99,7 +99,8 @@ public class DmaapProducerReactiveHttpClient {
addUserCredentialsToHead(headers);
- HttpEntity<byte[]> request = addFileToRequest(consumerDmaapModel, headers);
+ InputStream fileInputStream = getInputStream(consumerDmaapModel.getLocation());
+ HttpEntity<byte[]> request = addFileToRequest(fileInputStream, headers);
logger.trace("Starting to publish to DR");
@@ -129,10 +130,9 @@ public class DmaapProducerReactiveHttpClient {
headers.set(X_ATT_DR_META, metaData.toString());
}
- private HttpEntity<byte[]> addFileToRequest(ConsumerDmaapModel consumerDmaapModel, HttpHeaders headers)
+ private HttpEntity<byte[]> addFileToRequest(InputStream inputStream, HttpHeaders headers)
throws IOException {
- InputStream in = getInputStream(consumerDmaapModel.getLocation());
- return new HttpEntity<>(IOUtils.toByteArray(in), headers);
+ return new HttpEntity<>(IOUtils.toByteArray(inputStream), headers);
}
private InputStream getInputStream(String filePath) throws IOException {