Skip to content

Commit

Permalink
[rfxcom] 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 e8ce87b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

import java.io.IOException;

import org.apache.commons.io.IOUtils;
import org.eclipse.smarthome.core.util.HexUtils;
import org.openhab.binding.rfxcom.internal.config.RFXComBridgeConfiguration;
import org.slf4j.Logger;
Expand Down Expand Up @@ -77,11 +76,17 @@ public void disconnect() {

if (out != null) {
logger.debug("Close serial out stream");
IOUtils.closeQuietly(out);
try {
out.close();
} catch (IOException e) {
}
}
if (in != null) {
logger.debug("Close serial in stream");
IOUtils.closeQuietly(in);
try {
in.close();
} catch (IOException e) {
}
}

if (serialPort != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import java.io.OutputStream;
import java.util.TooManyListenersException;

import org.apache.commons.io.IOUtils;
import org.eclipse.smarthome.core.util.HexUtils;
import org.eclipse.smarthome.io.transport.serial.PortInUseException;
import org.eclipse.smarthome.io.transport.serial.SerialPort;
Expand Down Expand Up @@ -106,11 +105,17 @@ public void disconnect() {

if (out != null) {
logger.debug("Close serial out stream");
IOUtils.closeQuietly(out);
try {
out.close();
} catch (IOException e) {
}
}
if (in != null) {
logger.debug("Close serial in stream");
IOUtils.closeQuietly(in);
try {
in.close();
} catch (IOException e) {
}
}

if (serialPort != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import java.net.Socket;
import java.net.SocketTimeoutException;

import org.apache.commons.io.IOUtils;
import org.eclipse.smarthome.core.util.HexUtils;
import org.openhab.binding.rfxcom.internal.config.RFXComBridgeConfiguration;
import org.slf4j.Logger;
Expand Down Expand Up @@ -69,16 +68,25 @@ public void disconnect() {

if (out != null) {
logger.debug("Close tcp out stream");
IOUtils.closeQuietly(out);
try {
out.close();
} catch (IOException e) {
}
}
if (in != null) {
logger.debug("Close tcp in stream");
IOUtils.closeQuietly(in);
try {
in.close();
} catch (IOException e) {
}
}

if (socket != null) {
logger.debug("Close socket");
IOUtils.closeQuietly(socket);
try {
socket.close();
} catch (IOException e) {
}
}

readerThread = null;
Expand Down

0 comments on commit e8ce87b

Please sign in to comment.