public class DefaultDownloadHandler extends java.lang.Object implements DownloadHandler
DownloadHandler
that will display file save dialog where user can select the destination file.
Constructor and Description |
---|
DefaultDownloadHandler(javafx.scene.Node node) |
Modifier and Type | Method and Description |
---|---|
boolean |
allowDownload(DownloadItem download)
This method is invoked when Browser is going to download a file.
当浏览器要下载文件时,将调用此方法。 |
public boolean allowDownload(DownloadItem download)
DownloadHandler
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.
allowDownload
in interface
DownloadHandler
download
- information about the file that will be downloaded.
-有关将要下载的文件的信息。
TRUE
to allow downloading the file or
FALSE
to suppress it.
允许下载文件或禁止显示文件。