Package org.gbif.api.service.occurrence
Interface DownloadRequestService
public interface DownloadRequestService
Provides services to manage download requests and retrieve the download file. The services provided are:
- request inits a new download and assigns it a key *
- cancel cancels an existing download
- getResult retrieves the download file stream, if it is ready
- getResultFile retrieves the download file, if it is ready
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Cancels running download.create
(@NotNull DownloadRequest downloadRequest, String source) Creates a download request.getResultFile
(String downloadKey) getResultFile
(Download download)
-
Method Details
-
cancel
Cancels running download. If the download is not running throws an IllegalStateException. -
create
Creates a download request. If the request is successfully created its key is returned. -
getResult
- Parameters:
downloadKey
- of the corresponding download request- Returns:
- the input stream of the zipped download result file or null if it's not existing or ready yet
-
getResultFile
- Parameters:
downloadKey
- of the corresponding download request- Returns:
- the zipped download result file or null if it's not existing or ready yet
-
getResultFile
- Parameters:
download
- of the corresponding download request- Returns:
- the zipped download result file or null if it's not existing or ready yet
-