Skip to content

Commit

Permalink
Migrate to java.nio.file.createTempFile
Browse files Browse the repository at this point in the history
Use function from nio package as it uses more restrictive file permissions.

Signed-off-by: Holger Friedrich <[email protected]>
  • Loading branch information
holgerfriedrich committed Aug 20, 2023
1 parent d909543 commit 0ea4af4
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 :
Expand Down

0 comments on commit 0ea4af4

Please sign in to comment.