Removed usage to IOUtils.toString (#8579)

Specifically the toString reading from inputstream.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
This commit is contained in:
Hilbrand Bouwkamp
2020-09-25 20:46:14 +02:00
committed by GitHub
parent aa3f73d423
commit 1bc55a208b
13 changed files with 46 additions and 43 deletions

View File

@@ -14,6 +14,7 @@ package org.openhab.binding.fsinternetradio.test;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.charset.StandardCharsets;
import java.util.Collection;
import java.util.Collections;
import java.util.Map;
@@ -24,7 +25,6 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils;
import org.eclipse.jetty.http.HttpStatus;
import org.openhab.binding.fsinternetradio.internal.radio.FrontierSiliconRadioConstants;
@@ -238,11 +238,11 @@ public class RadioServiceDummy extends HttpServlet {
}
private String makeValidXMLResponse() throws IOException {
return IOUtils.toString(getClass().getResourceAsStream("/validXml.xml"));
return new String(getClass().getResourceAsStream("/validXml.xml").readAllBytes(), StandardCharsets.UTF_8);
}
private String makeInvalidXMLResponse() throws IOException {
return IOUtils.toString(getClass().getResourceAsStream("/invalidXml.xml"));
return new String(getClass().getResourceAsStream("/invalidXml.xml").readAllBytes(), StandardCharsets.UTF_8);
}
public void setInvalidResponse(boolean value) {