diff --git a/bundles/org.openhab.core.audio/src/main/java/org/openhab/core/audio/internal/AudioServlet.java b/bundles/org.openhab.core.audio/src/main/java/org/openhab/core/audio/internal/AudioServlet.java index fe5d448a9c0..f36fd82d46c 100644 --- a/bundles/org.openhab.core.audio/src/main/java/org/openhab/core/audio/internal/AudioServlet.java +++ b/bundles/org.openhab.core.audio/src/main/java/org/openhab/core/audio/internal/AudioServlet.java @@ -17,6 +17,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.nio.file.Files; import java.util.Collections; import java.util.List; import java.util.Map; @@ -297,7 +298,7 @@ private AudioStream createClonableInputStream(AudioStream stream, String streamI clonableAudioStreamResult = new ByteArrayAudioStream(dataBytes, stream.getFormat()); } else { // in memory max size exceeded, sound is too long, we will use a file - File tempFile = File.createTempFile(streamId, ".snd"); + File tempFile = Files.createTempFile(streamId, ".snd").toFile(); tempFile.deleteOnExit(); try (OutputStream outputStream = new FileOutputStream(tempFile)) { // copy already read data to file :