Reduce dependency on commons-io and commons-codec (#10614)

Signed-off-by: Wouter Born <github@maindrain.net>
This commit is contained in:
Wouter Born
2021-04-30 16:53:44 +02:00
committed by GitHub
parent 02b4943a11
commit e6d8dfb7e1
20 changed files with 175 additions and 124 deletions

View File

@@ -19,7 +19,6 @@ import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.apache.commons.io.IOUtils;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
import org.openhab.binding.sonos.internal.handler.ZonePlayerHandler;
@@ -118,7 +117,10 @@ public class SonosAudioSink implements AudioSink {
logger.warn("We do not have any callback url, so Sonos cannot play the audio stream!");
}
} else {
IOUtils.closeQuietly(audioStream);
try {
audioStream.close();
} catch (IOException e) {
}
throw new UnsupportedAudioStreamException(
"Sonos can only handle FixedLengthAudioStreams and URLAudioStreams.", audioStream.getClass());
// Instead of throwing an exception, we could ourselves try to wrap it into a