Class DownloadExecutor
- java.lang.Object
-
- bg.codexio.ai.openai.api.sdk.voice.speech.DownloadExecutor
-
public final class DownloadExecutor extends Object
Utility to download files with random names to a given folder
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FiledownloadTo(File targetFolder, bg.codexio.ai.openai.api.payload.voice.response.AudioBinaryResponse result, String mediaType)
-
-
-
Method Detail
-
downloadTo
public static File downloadTo(File targetFolder, bg.codexio.ai.openai.api.payload.voice.response.AudioBinaryResponse result, String mediaType) throws IOException
- Parameters:
targetFolder- where to download the fileresult- a result given by the OpenAI APImediaType- the extension of the file to be saved- Returns:
- the downloaded
Filewith random UUID name. - Throws:
IOException- if the target folder does not exist, or it's not writable
-
-