Package com.install4j.api.events
Class InstallerDownloadEvent
java.lang.Object
java.util.EventObject
com.install4j.api.events.InstallerEvent
com.install4j.api.events.InstallerDownloadEvent
- All Implemented Interfaces:
Serializable
The event object that is passed to installer event listeners for download events types.
Event listeners are registered in the
InstallerContext
.
This event object contains additional information about the download.
The event types EventType.BEFORE_DOWNLOAD
and EventType.AFTER_DOWNLOAD
produce this event object when fired.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
A listener that is informed about the progress of a download. -
Field Summary
Fields inherited from class java.util.EventObject
source
-
Constructor Summary
ConstructorsConstructorDescriptionInstallerDownloadEvent
(Object source, Context context, EventType type, boolean success, URL url, File downloadFile, long downloadSize) The constructor is called by the framework.InstallerDownloadEvent
(Object source, Context context, EventType type, URL url, File downloadFile, long downloadSize) The constructor is called by the framework. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a progress listener that is informed how the progress download is progressing.Returns the file where the download is saved.Get the complete set of download progress listeners.long
Returns the size for the download in bytes.getUrl()
Returns the URL of the download.Return a verbose description of this event.toString()
Methods inherited from class com.install4j.api.events.InstallerEvent
getContext, getType, setContext, wasSuccessful
Methods inherited from class java.util.EventObject
getSource
-
Constructor Details
-
InstallerDownloadEvent
public InstallerDownloadEvent(Object source, Context context, EventType type, boolean success, URL url, File downloadFile, long downloadSize) The constructor is called by the framework.- Parameters:
source
- the event sourcecontext
- the contexttype
- the event type.success
- whether the operation associated with the event was successfulurl
- the download URLdownloadFile
- the download filedownloadSize
- the size of the download
-
InstallerDownloadEvent
public InstallerDownloadEvent(Object source, Context context, EventType type, URL url, File downloadFile, long downloadSize) The constructor is called by the framework.- Parameters:
source
- the event sourcecontext
- the contexttype
- the event type.url
- the download URLdownloadFile
- the download filedownloadSize
- the size of the download
-
-
Method Details
-
getUrl
Returns the URL of the download.- Returns:
- the URL
-
getDownloadFile
Returns the file where the download is saved.- Returns:
- the download file
-
getDownloadSize
public long getDownloadSize()Returns the size for the download in bytes.- Returns:
- the size
-
addDownloadProgressListener
Add a progress listener that is informed how the progress download is progressing. This only makes sense to add if the event type isEventType.BEFORE_DOWNLOAD
.- Parameters:
listener
- the progress listener
-
getDownloadProgressListeners
Get the complete set of download progress listeners.- Returns:
- the set
-
toString
- Overrides:
toString
in classInstallerEvent
-
getVerbose
Description copied from class:InstallerEvent
Return a verbose description of this event.- Overrides:
getVerbose
in classInstallerEvent
- Returns:
- the description
-