public class InstallerDownloadEvent extends InstallerEvent
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.
InstallerEventListener
,
Context.addInstallerEventListener(InstallerEventListener)
,
Serialized FormModifier and Type | Class and Description |
---|---|
static interface |
InstallerDownloadEvent.DownloadProgressListener
A listener that is informed about the progress of a download.
|
Constructor and 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.
|
Modifier and Type | Method and 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 |
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() |
getContext, getType, setContext, wasSuccessful
public InstallerDownloadEvent(java.lang.Object source, Context context, EventType type, boolean success, java.net.URL url, java.io.File downloadFile, long downloadSize)
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 downloadpublic InstallerDownloadEvent(java.lang.Object source, Context context, EventType type, java.net.URL url, java.io.File downloadFile, long downloadSize)
source
- the event sourcecontext
- the contexttype
- the event type.url
- the download URLdownloadFile
- the download filedownloadSize
- the size of the downloadpublic java.net.URL getUrl()
public java.io.File getDownloadFile()
public long getDownloadSize()
public void addDownloadProgressListener(InstallerDownloadEvent.DownloadProgressListener listener)
EventType.BEFORE_DOWNLOAD
.listener
- the progress listenerpublic java.util.Set getDownloadProgressListeners()
public java.lang.String toString()
toString
in class InstallerEvent
public java.lang.String getVerbose()
InstallerEvent
getVerbose
in class InstallerEvent