Package org.zkoss.zkmax.zul
Interface FiledownloadListener
public interface FiledownloadListener
The listener used with
Filedownload.saveResumable(java.io.File, java.lang.String, java.lang.String) to reject
a download if the user tried to resume it in unacceptable situation.
Available in ZK EE
For example, you might allow the user to reuse the download
for, say, 24 hours, then you can pass a special key to denote it
in the data argument when calling Filedownload.saveResumable(java.io.File, java.lang.String, java.lang.String).
Then, you can check the data argument when onDownload(org.zkoss.util.media.Media, java.lang.Object, java.lang.String)
is called back.
- Since:
- 3.5.0
- Author:
- tomyeh
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionorg.zkoss.util.media.MediaonDownload(org.zkoss.util.media.Media media, Object source, String data) Notifies that the user is requesting the media to download.
-
Method Details
-
onDownload
Notifies that the user is requesting the media to download. It is used withFiledownload.saveResumable(java.io.File, java.lang.String, java.lang.String)to authenticate or filter the download.- Parameters:
media- the media that will be downloaded to the client.source- the source of the download. It is the file argument ofFiledownload.saveResumable(File, String, String), the url argument ofFiledownload.saveResumable(URL, String, String), and the path argument ofFiledownload.saveResumable(String, String, String).data- the data argument passed toFiledownload.saveResumable(java.io.File, java.lang.String, java.lang.String).- Returns:
- the media to be downloaded to the client. If you allow the download, you can return the value of the media argument. If you deny the download, just return null. If you want to alter the content, you can create a new instance and return it.
-