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:
java.io.Serializable
public class InstallerDownloadEvent extends InstallerEvent
The event object that is passed to installer event listeners for download events types. Event listeners are registered in theInstallerContext
.This event object contains additional information about the download. The event types
EventType.BEFORE_DOWNLOAD
andEventType.AFTER_DOWNLOAD
produce this event object when fired.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
InstallerDownloadEvent.DownloadProgressListener
A listener that is informed about the progress of a download.
-
Constructor Summary
Constructors Constructor Description InstallerDownloadEvent(java.lang.Object source, Context context, EventType type, boolean success, java.net.URL url, java.io.File downloadFile, long downloadSize)
The constructor is called by the framework.InstallerDownloadEvent(java.lang.Object source, Context context, EventType type, java.net.URL url, java.io.File downloadFile, long downloadSize)
The constructor is called by the framework.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDownloadProgressListener(InstallerDownloadEvent.DownloadProgressListener listener)
Add a progress listener that is informed how the progress download is progressing.java.io.File
getDownloadFile()
Returns the file where the download is saved.java.util.Set<InstallerDownloadEvent.DownloadProgressListener>
getDownloadProgressListeners()
Get the complete set of download progress listeners.long
getDownloadSize()
Returns the size for the download in bytes.java.net.URL
getUrl()
Returns the URL of the download.java.lang.String
getVerbose()
Return a verbose description of this event.java.lang.String
toString()
-
Methods inherited from class com.install4j.api.events.InstallerEvent
getContext, getType, setContext, wasSuccessful
-
-
-
-
Constructor Detail
-
InstallerDownloadEvent
public InstallerDownloadEvent(java.lang.Object source, Context context, EventType type, boolean success, java.net.URL url, java.io.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(java.lang.Object source, Context context, EventType type, java.net.URL url, java.io.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 Detail
-
getUrl
public java.net.URL getUrl()
Returns the URL of the download.- Returns:
- the URL
-
getDownloadFile
public java.io.File 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
public void addDownloadProgressListener(InstallerDownloadEvent.DownloadProgressListener listener)
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
public java.util.Set<InstallerDownloadEvent.DownloadProgressListener> getDownloadProgressListeners()
Get the complete set of download progress listeners.- Returns:
- the set
-
toString
public java.lang.String toString()
- Overrides:
toString
in classInstallerEvent
-
getVerbose
public java.lang.String getVerbose()
Description copied from class:InstallerEvent
Return a verbose description of this event.- Overrides:
getVerbose
in classInstallerEvent
- Returns:
- the description
-
-