Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit 9e645be

Browse files
authored
Removed Apache Common io utils. (#22)
1 parent 54d49fe commit 9e645be

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

pom.xml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@
4343
<version>1.18.16</version>
4444
</dependency>
4545

46-
<!-- https://mvnrepository.com/artifact/org.apache.commons/commons-io -->
47-
<dependency>
48-
<groupId>commons-io</groupId>
49-
<artifactId>commons-io</artifactId>
50-
<version>2.8.0</version>
51-
</dependency>
52-
5346
<!-- TESTING -->
5447
<dependency>
5548
<groupId>org.junit.jupiter</groupId>

src/test/java/de/filefighter/rest/ResponseResults.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
package de.filefighter.rest;
22

3-
import java.io.IOException;
4-
import java.io.InputStream;
5-
import java.io.StringWriter;
3+
import java.io.*;
64

7-
import org.apache.commons.io.IOUtils;
5+
import io.cucumber.messages.internal.com.google.common.io.CharStreams;
86
import org.springframework.http.client.ClientHttpResponse;
97

108
public class ResponseResults {
@@ -13,10 +11,12 @@ public class ResponseResults {
1311

1412
ResponseResults(final ClientHttpResponse response) throws IOException {
1513
this.theResponse = response;
16-
final InputStream bodyInputStream = response.getBody();
17-
final StringWriter stringWriter = new StringWriter();
18-
IOUtils.copy(bodyInputStream, stringWriter); //TODO: change maybe?
19-
this.body = stringWriter.toString();
14+
15+
String text;
16+
try (Reader reader = new InputStreamReader(response.getBody())) {
17+
text = CharStreams.toString(reader);
18+
}
19+
body = text;
2020
}
2121

2222
public ClientHttpResponse getTheResponse() {

0 commit comments

Comments
 (0)