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 FiledownloadFile(String filePath)FiledownloadFile(String filePath, File outputFile)FiledownloadFile(File file)FiledownloadFile(File file, File outputFile)InputStreamdownloadFileAsStream(String filePath)InputStreamdownloadFileAsStream(File file)voiddownloadFileAsync(String filePath, DownloadFileCallback<String> callback)voiddownloadFileAsync(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
-
-