Class DownloadExecutor
java.lang.Object
bg.codexio.ai.openai.api.sdk.voice.speech.DownloadExecutor
Utility to download files with
random names to a given folder
-
Method Summary
Modifier and TypeMethodDescriptionstatic FiledownloadTo(File targetFolder, bg.codexio.ai.openai.api.payload.voice.response.AudioBinaryResponse result, String mediaType)
-
Method Details
-
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
-