File tmpTargetFile;
try {
- tmpTargetFile = File.createTempFile(TMP_FILE_PREFIX, null);
+ tmpTargetFile = Files.createTempFile(TMP_FILE_PREFIX, null).toFile();
} catch (IOException e) {
logger.warn("Not able to create temporary file for downloading iCal. Error message is: {}", e.getMessage());
return;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.file.Files;
import org.openhab.core.audio.AudioException;
import org.openhab.core.audio.AudioFormat;
private String generateOutputFilename() throws AudioException {
File tempFile;
try {
- tempFile = File.createTempFile(Integer.toString(text.hashCode()), ".wav");
+ tempFile = Files.createTempFile(Integer.toString(text.hashCode()), ".wav").toFile();
tempFile.deleteOnExit();
} catch (IOException e) {
throw new AudioException("Unable to create temp file.", e);
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
+import java.nio.file.Files;
import org.eclipse.jdt.annotation.NonNullByDefault;
import org.eclipse.jdt.annotation.Nullable;
*/
private String generateOutputFilename() throws AudioException {
try {
- File tempFile = File.createTempFile(Integer.toString(text.hashCode()), ".wav");
+ File tempFile = Files.createTempFile(Integer.toString(text.hashCode()), ".wav").toFile();
tempFile.deleteOnExit();
return tempFile.getAbsolutePath();
} catch (IOException e) {