gpt4 book ai didi

Java网络启动: download only the first time?

转载 作者:行者123 更新时间:2023-11-30 03:17:30 25 4
gpt4 key购买 nike

我们有一个使用 java web start 运行的应用程序。它运行良好,并且通过指向 JNLP 的 HTML 链接启动。

但是,我们需要每天多次启动此应用程序。有没有办法不用每次启动时都下载它?我认为这会被放入缓存中,以便仅在第一次或更新后下载。

最佳答案

在 JNLP 文件中包含offline-allowed 选项。

我将引用documentation (我突出显示的相关部分):

offline-allowed element: The optional offline-allowed element indicates if the application can be launched offline.

If offline-allowed is specified, then the application can be launched offline by the Java Application Cache Viewer, and shortcuts can be created which launch the application offline.

If an application is launched offline, it will not check for updates and the API call BasicService.isOffline() will return true.

The offline-allowed element also controls how Java Web Start checks for an update to an application. If the element is not specified—i.e., the application is required to be online to run—Java Web Start will always check for an updated version before launching the application. And if an update is found, the new application will be downloaded and launched. Thus, it is guaranteed that the user always runs the latest version of the application. The application, however, must be run online.

If offline-allowed is specified, Java Web Start will also check to see if an update is available. However, if the application is already downloaded the check will timeout after a few seconds, in which case the cached application will be launched instead. Given a reasonably fast server connection, the latest version of the application will usually be run, but it is not guaranteed. The application, however, can be run offline.

关于Java网络启动: download only the first time?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32227479/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com