Skip to content

Commit

Permalink
[rme] 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 e3cf3d8
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import java.util.TooManyListenersException;
import java.util.stream.Collectors;

import org.apache.commons.io.IOUtils;
import org.eclipse.smarthome.core.thing.ChannelUID;
import org.eclipse.smarthome.core.thing.Thing;
import org.eclipse.smarthome.core.thing.ThingStatus;
Expand Down Expand Up @@ -123,8 +122,18 @@ public void dispose() {
if (serialPort != null) {
serialPort.removeEventListener();
}
IOUtils.closeQuietly(inputStream);
IOUtils.closeQuietly(outputStream);
if (inputStream != null) {
try {
inputStream.close();
} catch (IOException e) {
}
}
if (outputStream != null) {
try {
outputStream.close();
} catch (IOException e) {
}
}
if (serialPort != null) {
serialPort.close();
serialPort = null;
Expand Down

0 comments on commit e3cf3d8

Please sign in to comment.