Class PostDownloadHandler
java.lang.Object
org.openstreetmap.josm.actions.downloadtasks.PostDownloadHandler
- All Implemented Interfaces:
Runnable
The post-download handler notifies user of potential errors that occurred.
- Since:
- 2322
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Consumer<Collection<Object>>private final Future<?>private final DownloadTask -
Constructor Summary
ConstructorsConstructorDescriptionPostDownloadHandler(DownloadTask task, Future<?> future) Creates a newPostDownloadHandlerPostDownloadHandler(DownloadTask task, Future<?> future, Consumer<Collection<Object>> errorReporter) Creates a newPostDownloadHandlerusing a custom error reporter -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanaddNoDataErrorMessage(String message) Adds a new translated error message indicating that no data has been downloaded.static booleanisNoDataErrorMessage(Object message) Determines if a translated error message indicates that no data has been downloaded.voidrun()
-
Field Details
-
task
-
future
-
errorReporter
-
NO_DATA_ERROR_MESSAGES
-
-
Constructor Details
-
PostDownloadHandler
Creates a newPostDownloadHandler- Parameters:
task- the asynchronous download taskfuture- the future on which the completion of the download task can be synchronized
-
PostDownloadHandler
public PostDownloadHandler(DownloadTask task, Future<?> future, Consumer<Collection<Object>> errorReporter) Creates a newPostDownloadHandlerusing a custom error reporter- Parameters:
task- the asynchronous download taskfuture- the future on which the completion of the download task can be synchronizederrorReporter- a callback to inform about the number errors happened during the download task
-
-
Method Details
-
addNoDataErrorMessage
Adds a new translated error message indicating that no data has been downloaded.- Parameters:
message- new translated error message indicating that no data has been downloaded.- Returns:
trueif the message was not already known- Since:
- 15358
-
isNoDataErrorMessage
Determines if a translated error message indicates that no data has been downloaded.- Parameters:
message- translated error message to check- Returns:
trueif the message indicates that no data has been downloaded- Since:
- 15358
-
run
-