Skip to content

Commit

Permalink
[lirc] Removed dependency on 'org.apache.commons.io.IOUtils'
Browse files Browse the repository at this point in the history
Relative to openhab#7722

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
  • Loading branch information
lolodomo committed May 22, 2020
1 parent efc84f1 commit 9b57617
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;

import org.apache.commons.io.IOUtils;
import org.openhab.binding.lirc.internal.config.LIRCBridgeConfiguration;
import org.openhab.binding.lirc.internal.messages.LIRCButtonEvent;
import org.openhab.binding.lirc.internal.messages.LIRCResponse;
Expand Down Expand Up @@ -75,22 +74,31 @@ public void disconnect() {
}
if (outWriter != null) {
logger.debug("Close print writer stream");
IOUtils.closeQuietly(outWriter);
outWriter.close();
outWriter = null;
}
if (out != null) {
logger.debug("Close tcp out stream");
IOUtils.closeQuietly(out);
try {
out.close();
} catch (IOException e) {
}
out = null;
}
if (in != null) {
logger.debug("Close tcp in stream");
IOUtils.closeQuietly(in);
try {
in.close();
} catch (IOException e) {
}
in = null;
}
if (socket != null) {
logger.debug("Close socket");
IOUtils.closeQuietly(socket);
try {
socket.close();
} catch (IOException e) {
}
socket = null;
}
logger.debug("Disconnected");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import java.util.regex.Matcher;
import java.util.regex.Pattern;

import org.apache.commons.io.IOUtils;
import org.openhab.binding.lirc.internal.LIRCResponseException;
import org.openhab.binding.lirc.internal.messages.LIRCButtonEvent;
import org.openhab.binding.lirc.internal.messages.LIRCResponse;
Expand Down Expand Up @@ -104,7 +103,10 @@ public void run() {
logger.error("Invalid message received", e);
}
}
IOUtils.closeQuietly(reader);
try {
reader.close();
} catch (IOException e) {
}
}

private void processResponse(String responseText) throws LIRCResponseException {
Expand Down

0 comments on commit 9b57617

Please sign in to comment.