Skip to content

Commit

Permalink
[urtsi] Removed dependency on 'org.apache.commons.io.IOUtils' (openha…
Browse files Browse the repository at this point in the history
…b#7736)

Relative to openhab#7722

Signed-off-by: Laurent Garnier <lg.hc@free.fr>
Signed-off-by: Daan Meijer <daan@studioseptember.nl>
  • Loading branch information
lolodomo authored and DaanMeijer committed Sep 1, 2020
1 parent 81ec6c0 commit 55c371a
Showing 1 changed file with 19 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import java.util.TooManyListenersException;
import java.util.stream.Collectors;

import org.apache.commons.io.IOUtils;
import org.eclipse.smarthome.core.thing.Bridge;
import org.eclipse.smarthome.core.thing.ChannelUID;
import org.eclipse.smarthome.core.thing.Thing;
Expand Down Expand Up @@ -205,11 +204,28 @@ public void initialize() {
@Override
public void dispose() {
super.dispose();
IOUtils.closeQuietly(outputStream);
IOUtils.closeQuietly(inputStream);
if (serialPort != null) {
serialPort.removeEventListener();
}
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
logger.debug("Error while closing the output stream: {}", e.getMessage());
}
}
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
logger.debug("Error while closing the input stream: {}", e.getMessage());
}
}
if (serialPort != null) {
serialPort.close();
}
outputStream = null;
inputStream = null;
serialPort = null;
}
}

0 comments on commit 55c371a

Please sign in to comment.