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.