public interface DownloadHandler
allowDownload(DownloadItem)
method will be used to check whether this file can be downloaded. If this method returns
TRUE
, the file download is started.
You can use this handler to suppress all file downloads or download only files with a specific mime type.
Modifier and Type | Method and Description |
---|---|
boolean |
allowDownload(DownloadItem download)
This method is invoked when Browser is going to download a file.
当浏览器要下载文件时,将调用此方法。 |
boolean allowDownload(DownloadItem download)
download
parameter contains all information about the the file which is going to be downloaded.
To suppress file download, this method must return
FALSE
.
By default the file will be downloaded into application's working directory. You can get the absolute file path using the
DownloadItem.getDestinationFile()
method. In order to change the destination path, you can use the
DownloadItem.setDestinationFile(java.io.File)
method.
download
- information about the file that will be downloaded.
-有关将要下载的文件的信息。
TRUE
to allow downloading the file or
FALSE
to suppress it.
允许下载文件或禁止显示文件。