Class TelegramFileDownloader
- java.lang.Object
-
- org.telegram.telegrambots.facilities.filedownloader.TelegramFileDownloader
-
public class TelegramFileDownloader extends Object
Wraps the file downloading code into one class.- Version:
- 1.0
- Author:
- Chase22
-
-
Constructor Summary
Constructors Constructor Description TelegramFileDownloader(Supplier<String> botTokenSupplier)
TelegramFileDownloader(org.apache.http.client.HttpClient httpClient, Supplier<String> botTokenSupplier)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description File
downloadFile(String filePath)
File
downloadFile(String filePath, File outputFile)
File
downloadFile(File file)
File
downloadFile(File file, File outputFile)
InputStream
downloadFileAsStream(String filePath)
InputStream
downloadFileAsStream(File file)
void
downloadFileAsync(String filePath, DownloadFileCallback<String> callback)
void
downloadFileAsync(File file, DownloadFileCallback<File> callback)
-
-
-
Method Detail
-
downloadFile
public final File downloadFile(String filePath) throws TelegramApiException
- Throws:
TelegramApiException
-
downloadFile
public final File downloadFile(File file) throws TelegramApiException
- Throws:
TelegramApiException
-
downloadFile
public final File downloadFile(File file, File outputFile) throws TelegramApiException
- Throws:
TelegramApiException
-
downloadFile
public final File downloadFile(String filePath, File outputFile) throws TelegramApiException
- Throws:
TelegramApiException
-
downloadFileAsStream
public final InputStream downloadFileAsStream(String filePath) throws TelegramApiException
- Throws:
TelegramApiException
-
downloadFileAsStream
public final InputStream downloadFileAsStream(File file) throws TelegramApiException
- Throws:
TelegramApiException
-
downloadFileAsync
public final void downloadFileAsync(String filePath, DownloadFileCallback<String> callback) throws TelegramApiException
- Throws:
TelegramApiException
-
downloadFileAsync
public final void downloadFileAsync(File file, DownloadFileCallback<File> callback) throws TelegramApiException
- Throws:
TelegramApiException
-
-