Skip to content

Commit

Permalink
[plugwise] 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 52a84c3
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.concurrent.locks.ReentrantLock;
import java.util.stream.Collectors;

import org.apache.commons.io.IOUtils;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.eclipse.smarthome.io.transport.serial.PortInUseException;
Expand Down Expand Up @@ -97,8 +96,18 @@ public void closeSerialPort() {
SerialPort localSerialPort = serialPort;
if (localSerialPort != null) {
try {
IOUtils.closeQuietly(localSerialPort.getInputStream());
IOUtils.closeQuietly(localSerialPort.getOutputStream());
if (localSerialPort.getInputStream() != null) {
try {
localSerialPort.getInputStream().close();
} catch (IOException e1) {
}
}
if (localSerialPort.getOutputStream() != null) {
try {
localSerialPort.getOutputStream().close();
} catch (IOException e1) {
}
}
localSerialPort.close();
serialPort = null;
} catch (IOException e) {
Expand Down

0 comments on commit 52a84c3

Please sign in to comment.